A Category
Category: Category (class, category) (OC)
Name: The original class + category name (the original class name is automatically generated, just write the following category name, usually the module name.) such as the original class person, new classification Ct,person+ct)
The role of classification: without changing the contents of the original class, you can add some methods to our class.
Attention:
1. Classification can only add methods and cannot increase member variables.
2. In the implementation of the classification method, the member variables in the original class can be accessed.
3. Classifications can override methods of the original class. However, the methods that overwrite the original class (the method of overriding the original class are not generally categorized).
4. Call Priority: Classification Precedence (The last class that participates in compilation is called first).
OC is a weak grammar.
IOS (vi) Category categories