IOS中boolean Boolean B…

阅读 49

2023-03-30

boolean 是int型
Boolean mac os上有历史意义的类型
 BOOL 是unsigned char型,BOOL b 当b=1 b=YES //IOS Style
是int型,bool b 当b>1 b=YES //c /C++style
 

 boolean_t t1 = 1;//int type
 Boolean t2 = 1; //unsigned char type
 BOOL t3 = 4;//YES or NO
 bool t4 = 1;//true or false NSAssert(t1, @"boolean_t t1 is NO");//通过测试
 NSAssert(t2, @"boolean_t t2 is NO");//通过测试
 NSAssert(t3, @"boolean_t t3 is NO");//通过测试
 NSAssert(t4, @"boolean_t t4 is NO");//通过测试
 

精彩评论(0)

0 0 举报