4 kind of zeros are used in objective c - nil, Nil, NULL and NSNull. All of these are different with their properties. Usually in programming nil and NSNull are used in objective c and NULL is used with c/c++ statements. Type of nil is defined as "id"(object in objective c) and NULL as "void *".NSNull worked as an object when nil is not allowed.
NULL has a value of (void *)0 and used for null value for C pointers.
nil has a value of (id)0 and used for null value for Objective-C objects.
Nil has a value of (Class)0 and used for null value for Objective-C classes.
NSNull has a value of [NSNull null] and used for singleton object used to represent null.
0 Comment(s)