I have a numeric string and there is a discrepancy where it is intValuevery different from its string value. Code below:
NSString *string = [result objectForKey:@"id"];
NSLog(@"ID %@",string);
NSLog(@"ID as integer %i",[string intValue]);
gives the result:
"ID 100004378121454"
"ID as integer 2147483647"
The only logical guess I can make is that the string is too long to convert it to int... In any case, I tried longLongValue, etc. - to different results, but not to those that should be.
source
share