The following code will identify if a string is an integer - that is, the string contains only digits. But, I hate this code. What is a better way?
NSString *mightBeAnInteger = fooString;
int intValue = [fooString intValue];
if (intValue > 0
&& [[NSString stringWithFormat:@"%d",intValue] isEqualToString:mightBeAnInteger]) {
NSLog(@"mightBeAnInteger is an integer");
}