|
Nil: null pointer pointing to objects in Objective-C language, which is the definition of value (id) 0.
Nil: point to Objective-C language class (Class) null pointer, defined value (Class) 0.
NULL: point C language standard null pointer, which is defined value (void *) 0.
NSNull: a collection of objects in Objective-C language, the objects that represent null values, defined value [NSNull null]. [NSNull null] is an object that can not be used with nil in the case.
Because NSArray and NSDictionary in nil has a special meaning (denote the end of the list), so you can not put nil value in the collection. As "nothing" to do need to store the value of a representation, you can use NSNull class. Example: [NSMutableArrayObj addObject: [NSNull null]];
If obj is nil: [obj message] returns NO, instead NSException.
If obj is NSNull: [obj message] will throw an exception NSException. |
|
|
|