Alex Rivera | Logout

How to log an long long value with NSLog?

Asked 2010-01-24T15:08:59.893
33

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...
Edit
Report

2 Answers

35

The String Format Specifiers section of the String Programming Guide for Cocoa is a great bookmark for your browser ... ;-)

answered 2010-01-24T15:15:31.110
0

Yet another way though unnecessary if it's a plain old type and not already an NSNumber, if you convert this to an NSNumber or something similar then the included format method will automatically do the right thing if you just use %@.

answered 2010-01-24T17:45:13.333

Your Answer