The quick and simple way to log the value of most datatypes in objective-C.
NSLog(@"%d", somenumber); |
The other options are:
%@ Object %d, %i signed int %u unsigned int %f float/double %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 |
Source from this blog
This is what I was looking for. Thanks.
EXACTLY what I was looking for,
thanks for the summary!
/Tommy
how do u print boolean?
joel: You can create an NSNumber object with a boolean value – and then output the intValue of the NSNumber… that’s how I have done it in the past.