I want to do something like this:
NSLog(@"You got: %x", booleanValue);
where x is the specifier. But I can't find one! I want to avoid:
if (booleanValue) {
NSLog(@"You got: YES");
}
else {
NSLog(@"You got: NO");
}
Any ideas? The docs didn't have a Boolean specifier. %@
didn't work either.
Here are two things that work:
NSLog(@"You got: %@",booleanValue ? @"YES" : @"NO");
or you can cast:
NSLog(@"You got: %d", (int)booleanValue);
Which will output 0 or 1