Moshe Moshe - 1 year ago 174
Objective-C Question

Objective-C formatting string for boolean?

What formatter is used for boolean values?



NSLog(@" ??", BOOL_VAL);
, what is

Answer Source

One way to do it is to convert to strings (since there are only two possibilities, it isn't hard):

NSLog(@" %s", BOOL_VAL ? "true" : "false");

I don't think there is a format specifier for boolean values.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download