Navigation:
Basic data Types
Object Type
ID Type
1. Basic Data TypesThe basic types in objective-c are the same as the basic types of C, mainly:Int,long,float,double,char,void,boolAnd so on. It is important to note that in the Foundation framework, the system aliases some data, such as:Nsintegeris long,CGFloatis double, andBOOLAs Objective-c is a superset of C, it is possible to use the C language construction type in OC, such as: arrays, structures, etc. * For basic data types, pointers are not required and manual recycling is not required, and the system is automatically reclaimed by the method execution end.
2. Object TypeThe data types of common object types are:-nslog-NSNumber-NSStringand nsmutablestring-Nsarrayand Nsmutablearray-nsset and nsmutableset-.nsdictionaryand Nsmutabledictionary
3.id Type:In the Objective-c,ID Typeis a unique data type that can be converted to any data type, that is, a variable of type ID can hold an object of any data type. In internal processing, this type is defined as a pointer to an object. is actually a pointer to an instance variable of such an object. ID is an object that points to any of the inherited NSObject classes. Because the ID is a pointer, you do not need to precede the asterisk * when using the ID.
4. Other Special data types(Nil, nil, SEL, etc.)NilSame as NULL in C, defined in Objc.h. Nil represents a Objective-c object, and the pointer to this object points to null. (Nothing is empty.)NilThe first uppercase nil is a little bit different from nil, and nil defines a class that points to an empty (note that class, not object)SELThe first contact when the teacher said to meet it to replace it with @selector, SEL is a type of "selector", which represents the name of a method. For example, the method of ordering an array in a call: Sortedarrayusingselector: (SEL), the SEL will appear and we can fill in the SEL@selector (compare:)Selector is followed by a method that you need to use. There are many not very common data types, I do not list the author.
Data types in the Objective-c