Recently the mood is not very good, often the mood is not very good when likes to learn something, writes something, specifically because what mood is not too fortunately here does not give everybody to explode the material!
Anyway
1, Nil defines an instance as null, pointing to a null pointer to an object in OC.
Note: When you release an object and assign the object a value of nil, this ensures security.
2, NULL is commonly used in C language to represent a null value.
Note: In Objective-c, the nil object is designed to be associated with a NULL null pointer. The difference is that nil is an object, and null is just a value. And we're not going to generate crash or throw exceptions for the nil call method.
3. Nil is used to define an empty class
Example: Class SomeClass = Nil;
4. The Nsnull class defines a singleton object used to represent the null value of the collection object.
Note: The collection object cannot contain nil as its specific value, such as Nsarray, Nsset, and Nsdictionary. Accordingly, the nil value is represented by a specific object nsnull. Nsnull provides a single instance for representing the nil value in the object's properties. The default implementation method, Dictionarywithvaluesforkeys: And setvaluesforkeyswithdictionary: automatically converts nsnull and nil to each other, so your object does not require nsnull test operations .
The difference between nil,null,nil,nsnull in iOS