Objectivec 中 nil, Nil, NULL和NSNull的区别

nil: A null pointer to an Objective-C object. ( #define nil ((id)0)  )

Nil: A null pointer to an Objective-C class.

NULL: A null pointer to anything else,  is for C-style memory pointers. ( #define NULL ((void *)0)  )

NSNull: A class defines a singleton object used to represent null values in collection objects (which don't allow nil values). [NSNull null]: The singleton instance of NSNull. http://blog.csdn.net/yhawaii/article/details/7442529

原文地址:https://www.cnblogs.com/hjyxbfz/p/2978420.html