Skip to content

Instantly share code, notes, and snippets.

@jkosoy
Created December 22, 2012 15:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkosoy/4359595 to your computer and use it in GitHub Desktop.
Save jkosoy/4359595 to your computer and use it in GitHub Desktop.
NSLog datatypes, courtesy http://snipplr.com/view/21403/
NSLog(@"%@", [NSNumber numberWithInt:i]);
/*
%@ Object
%d, %i signed int
%u unsigned int
%f float/double
%1.2f to controll number of decimals
%x, %X hexadecimal int
%o octal int
%zu size_t
%p pointer
%e float/double (in scientific notation)
%g float/double (as %f or %e, depending on value)
%s C string (bytes)
%S C string (unichar)
%.*s Pascal string (requires two arguments, pass pstr[0] as the first, pstr+1 as the second)
%c character
%C unichar
%lld long long
%llu unsigned long long
%Lf long double
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment