2010年5月27日 星期四

nil vs Nil vs Null vs NSNull null

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.
(#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.