Friday, May 6, 2011

NSLog example

Following code fragments shows some useful tips of NSLog method.


You can display hexa values using NSLog method with %x formatter.

NSLog(@"Hex value: 0x%08x", 0x1234);

You can even display current method name in execution using NSLog method.
NSLog(@"%s", __PRETTY_FUNCTION__, nil);