nil:指向oc中对象的空指针
Nil:指向oc中类的空指针
NULL:指向其他类型的空指针,如一个c类型的内存指针
NSNull:在集合对象中,表示空值的对象
若obj为nil:[obj message]将返回NO,而不是NSException
若obj为NSNull:[obj message]将抛出异常NSException
下面是官方文档的解释:
nil
Defines the id
of a null instance.
Available in iOS 4.0 and later.
Nil
Defines the id
of a null class.
Available in iOS 4.0 and later.
NSNull
The NSNull
class defines a singleton object used to represent null values in collection objects (which don’t allow nil
values).(NSNull类定义了一个单例对象用于表示null值的集合对象(不允许零值)。)
Returns the singleton instance of NSNull
.(NSNull返回单例实例。)
原文:http://www.cnblogs.com/zzq1580443149/p/4842518.html