How to log an long long value with NSLog?

openfrog picture openfrog · Jan 24, 2010 · Viewed 24.5k times · Source

How can I do that? What's the format specifier?

For example, I have:

long long veryLong = // assume value here
NSLog(@"%f", veryLong); // of course wrong...

Answer

David Kanarek picture David Kanarek · Jan 24, 2010
long long veryLong = // assume value here
NSLog(@"My long long is: %lld", veryLong); // now it's right