I need to check the type of each element in an array...
for(id obj in items) {
if([obj isKindOfClass:[NSString class]]) {
//handle string case
} else if([obj isKindOfClass:[NSInteger class]]) { //THIS LINE GIVES ERROR
//handle int case
}
}
Of course NSInteger
is just an alias for int
, so how can I check for this at runtime?