Tuesday, 12 July 2011

How to print BOOL in NSLog

Was trying various ways to dump the value of a BOOL in NSLog for debugging and couldn't get it to work properly. Did a quick search on the net and quickly found the solution as below, just convert it into a NSString!


NSLog(@"isTwoPlayerMode=%@", ([currentGameData isTwoPlayerMode] ? @"YES" : @"NO"));

No comments:

Post a Comment