Obj-C determing integer values with isKindOfClass
objective-c
Solution
You can't actually store `NSInteger` in an `NSArray`, since it isn't an object. If you are storing numbers in your array, they are most likely instances of `NSNumber`, so you would check for:
if ([obj isKindOfClass:[NSNumber class]]) { ... }
iPhone Developer Tips gives a good summary of the difference between `NSInteger` and `NSNumber`.
Problem
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?