Is there a format specifier that works with Boolean values?

后端 未结 6 1712
悲&欢浪女
悲&欢浪女 2021-02-12 14:17

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:

6条回答
  •  借酒劲吻你
    2021-02-12 14:38

    On Swift, use String(describing: booleanValue)

    For example: os_log("You got %@", log: .default, type: .debug, String(describing: booleanValue))

提交回复
热议问题