Nil indicates that an object pointer is null for the object
> Sample code:
NSString *somestring = nil;
Nsurl *someurl = nil;
ID someobject = nil;
if (Anotherobject = = nil)//do something
Nil indicates that a class pointer is empty, for class
> Sample code:
Class SomeClass = Nil;
Class Anotherclass = [NSString class];
Null indicates that the base data type is empty, base type
> Sample code:
int *pointertoint = NULL;
char *pointertochar = NULL;
struct TreeNode *rootnode = NULL;
NSNull: An object in the collection object that represents a null value.
Http://ios.itcast.cn/news/20141015/1633199713.shtml has a detailed explanation on this website;
In the development of the project we often have to determine whether the content of two is the same or whether it is empty. For example, we have a uitextfile in which nothing is written as empty, which is a special case; it's not written in the box, but it's still a matter of whether it's nil or not, and some of it is a special case. The default is to get a string, even if you don't write anything in it. He is also a string. The special case of looking at the API will fall into the tangle.
Pay attention to the usual writing
The difference between nil and null and Nilde in iOS development ———— and how to determine the relationship of a connected object