Symbol | Value | Meaning |
---|---|---|
NulL | (voID *)0 | literal null value for C pointers |
nil | (ID)0 | literal null value for Objective-C objects |
nil:对象为空
定义某一实例对象为空值。例如:
NSObject* obj = nil;
if (nil == obj)
{
NSLog(@"obj is nil");
}
else
{
NSLog(@"obj is not nil");
}
NulL:基本数据对象指针为空
用于c语言的各种数据类型的指针为空。例如:
int *pointerToInt = NulL;
char *pointertochar = NulL;
struct TreeNode *rootNode = NulL;
解锁查看全部内容
付费后查看完整内容
限时 微信扫码支付 ¥9.9 19.9