相似相近宏定义区别
作者:
一盘菜十斤米 | 来源:发表于
2018-12-28 18:41 被阅读0次
1、关于NULL Nil nil NSUll
- NULL 0 C中的空地址 (值为 (void *)0 )
- nil (id) 0 Objective-C对象的空指针 (值为 (void *)0 )
- Nil (Class) 0 Objective-C类的空指针 (值为 (void *)0 )
- NSNull [NSNull null] 用来表示零值的单独的对象(并非空指针)
2、BOOL bool boolean
objc.h
typedef signed char BOOL;
#define YES (BOOL)1
#define NO (BOOL)0
stdool.h
#C99标准定义了一个新的关键字_Bool,提供了布尔类型
#define bool _Bool
#define true 1
#define false 0
MacTypes.h
typedef unsigned char Boolean;
enum DYLD_BOOL { FALSE, TRUE };
本文标题:相似相近宏定义区别
本文链接:https://www.haomeiwen.com/subject/oiuelqtx.html
网友评论