Decoding Long Long Integer Values in Objective-C

Decoding Long Long Integer Values in Objective-C

In the interest of saving someone else some grief, here’s how to decode long long (64-bit) integers in Objective-C:

long long veryLong = 0;

[[NSScanner scannerWithString:@"100001621738699"] scanLongLong:&veryLong];

NSLog(@"Checking '100001621738699': %qi", veryLong);

One usually runs into long longs when dealing with Facebook Ids. I’ve written on this before, here.

Happy Coding.