Objective-C formatting string for boolean?

后端 未结 9 1726
情深已故
情深已故 2020-12-13 11:38

What formatter is used for boolean values?

EDIT:

Example: NSLog(@\" ??\", BOOL_VAL);, what is ?? ?

9条回答
  •  一整个雨季
    2020-12-13 12:16

    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.

提交回复
热议问题