Objective-C Runtime, doesn't know how to implement Category.

you can easily add methods and attributes with Category through Objective-C Runtime,.

his implementation principle is the object structure, objc_class contains the methodLists, is a secondary pointer, a pointer to the pointer.

   struct objc_method_list **methodLists OBJC2_UNAVAILABLE;// 

methodLists represents the list of methods, which can be dynamically modified to implement Category.

Resources: https://www.jianshu.com/p/c0b.

is still a little confused, how to understand better

< H2 > specifically, where did you deal with the addition of the method < / H2 >

https://opensource.apple.com/.
next source code to take a look at

Menu