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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s