1. + (void)load method
The Runtime calls the load method only once when the class or class is loaded (before main is started).
Call the principle
Instead of going through the obj_msgSend process, the load method is called by assigning the memory address of the load method to a pointer called load_method.
Call to order
1. Call the load method of the class first
Call in compile order (compile first call first) The subclass load method is called before the parent class load method is called
2. Invoke the load method of the classification
Call in compile order (compile first call first)
(2) + (void) the initialize method
The Initialize method is called the first time the class receives a message.
Call the principle
Call obj_msgSend, so the initialize of the class overrides the initialize of the original class.
Call to order
Initialize is called first from the parent class and then from the subclass. If the subclass does not implement initialize, the initialize method of the parent class will be called when the initialize method of the subclass is called. 2. If the initialize method of a subclass has not been initialized, the initialize method of the parent class will be called first, and then the initialize method of the subclass will be called. 3. The initialize of the class overrides the initialize of the original class.