1 category
Classification provides a way to extend the class definition. Classification can access the instance variables of the original class. Pay attention to the following points when using classification:
1.1 you cannot add any variables of the category. If you want to add variables, consider creating them.
1.2 another method in this class can be reloaded for classification, but please do not try this. That is, Do not overload another method in the override class in the category.
1.3 A class can have many categories.
1.4 The Methods declared in classification can not be implemented in implementation. (Can be implemented later)
1.5 classification can also implement protocols, such as @ interface fraction (stuff) <nscopying, nscoding>
2 protocol
The Protocol is the interface in other languages. Objective-C 2.0 adds the optional keyword to the Protocol, indicating that this method is optional. This replaces informal protocols.
Informal Protocol: it is actually a classification, listing a group of methods, but not implementing them. Sometimes informal protocols are also called abstract protocols.
ID <nscopying, nscoding> currobj
This statement tells the compiler that currobj will contain objects that comply with the nscopying and nscoding protocols. If not, a warning will be given.
3 type conversion
4. PreprocessingProgram
5 Scope