Moshe Moshe - 3 months ago 6
Objective-C Question

Objective-C formatting string for boolean?

What formatter is used for boolean values?

EDIT:

Example:

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

Answer

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.

Comments