What formatter is used for boolean values?
EDIT:
Example: NSLog(@\" ??\", BOOL_VAL);
, what is ??
?
Just add the below function and pass it the BOOL
value and method will return back the NSString
- (NSString *)boolValueToString:(BOOL)theBool {
if (theBool == 0)
return @"NO"; // can change to No, NOOOOO, etc
else
return @"YES"; // can change to YEAH, Yes, YESSSSS etc
}
I believe the easiest way to do this is:
NSLog(@" %@", @(BOOL_VAL));
@(expression)
Dynamically evaluates the boxed expression and returns the appropriate object literal based on its value (i.e. NSString for const char*, NSNumber for int, etc.).
Use the integer formatter %d
, which will print either 0
or 1
:
NSLog(@"%d", myBool);