How to define a BOOL constant?

后端 未结 3 1305
既然无缘
既然无缘 2021-02-19 11:14

I know how to do it for a float:

#define kMyConstant 1.0f

but how could I do that fora BOOL value?

3条回答
  •  北恋
    北恋 (楼主)
    2021-02-19 11:47

    I would do it differently:

    enum { MyConstantBool = YES };
    

    It's a constant, it doesn't take up storage space.

提交回复
热议问题