1. Nil
A null pointer pointing to an objective-C object
RepresentsObjectNull: nsstring * STR = nil; (# define nil (ID) 0 ))
2. Nil
A null pointer pointing to an objective-C Class Object.
RepresentsClassObjectNull: Class class = nil;
3. null
The objective-C value type is null: int number = NULL; (equivalent to int number = 0;) (# define null (void *) 0 ))
4. nsnull
A class definesSingleton objectUsed to indicate the null value in the collection object (nil value not allowed ).
#import <Foundation/NSObject.h>@interface NSNull : NSObject <NSCopying, NSCoding>+ (NSNull *)null;@end
[Nsnull null]; a singleton object is null.
5. Differences between nil and nsnull object message calls
If an object is equal to nil, no message is called and no exception is thrown;
If the object is of the nsnull type, an exception is thrown when a message is sent.
6. Note:
In objective-C, nsarray, nsdictionary, and nsset may all contain nsnull objects,
Therefore, if they contain nsnull objects, the program will crash.
Reference: http://blog.csdn.net/yhawaii/article/details/7442529