1.nil
>Defines the id of a null instance.
定义一个实例为空, 指向oc中对象的空指针.
>示例代码:
NSString *someString = nil;
NSURL *someURL = nil;
id someObject = nil;
if (anotherObject == nil) // do something
3.Nil
>Defines the id of a null class.
定义一个空的类
Available in Mac OS X v10.0 through Mac OS X v10.4.
Declared in NSObjCRuntime.h.
Declared Inobjc.h
>示例代码:
Class someClass = Nil;
Class anotherClass = [NSString class];
4.NSNull
>The NSNull class defines a singleton object used to represent null values in collection objects (which don’t allow nil values).
NSNull类定义了一个单例对象用于表示集合对象的空值