Frontier:
A Brief Introduction to the composition of Objective C classes includes the methods of attributes, variables, methods, and multiple parameters.
Step One select and create a class
Step Two create an H file
Notes:
1 + and-
+ Static method (class method)-object method (called only after an instance is required)
2The variables in interface {} are private variables of the class, and the External table cannot be called.
3 @ property indicates the property
Description of common parameters
Nonatomic: Non-atomic, thread unsafe
Atomic: atomic
Readwrite: read/write
Readonly: Read-Only
Copy is used to create and allocate a new space and copy the content from the original address.
Assign is just a simple pointer transfer.
Retain is after passing the pointer retainCount + 1
4 multi-parameter method implementation
The multi-parameter method implementation in other languages is generally the void method name (Data Format parameter 1, data format parameter 2 );
Multi-parameter methods in objective C are implemented
The advantage of this method is that it is helpful for reading
Step Three create m file
Note:
@ Synthesize carno = _ carno; implement attributes and create the SetCarno set method at the same time (if the set method is not implemented, attributes cannot be set)