Reputation: 9579
For an object it is
NSLog(@"some object %@", someObject);
For decimal it is:
NSLog(@"some object %d", 2.33);
What is it for a bool?
Upvotes: 3
Views: 4171
Reputation: 9536
Treat it like an int:
NSlog(@"%d",yourBool)
... outputs 1 for YES and 0 for NO
If you want to get a YES/NO output use:
NSLog(@"%@", (yourBool ? @"YES" : @"NO"));
The reason, copy-pasted from objc.h:
#define YES (BOOL)1
#define NO (BOOL)0
PS: For decimals (floats) it's not %d.... its:
NSLog(@"%f",2.33);
Upvotes: 7