In OC, the classes in the library can be extended on an original basis.
For example, to add new attribute variables and methods to nssting, you can create a new. m file in Xcode
Select the corresponding original class
Then you can select the extension or classification, the classification will be automatically connected with the + number, the extension will automatically connect with _, such as
"Nsstring+security.h"
"Nsstring_extension.h"
The extension can add attribute variables and methods, but only adds a new header file
Categories can add methods, cannot add attribute variables, have a header file and a. m file, and M files can implement specific methods
So in the classification of reference to the extension of the header file, you can do a method of a class of property variables to add, and in the M file can be implemented in specific ways
IOS uses categories category and extension extension