kvo and runtime

Create a new class

Add Method

isa-swizzling

 

Test program:

Add a global breakpoint

objc_allocateClassPair

objc_registerClassPair

class_addMethod

 

And dynamically add properties in this class, the Runtime functions are primarily
1) .objc_allocateClassPair-- With this function, can create a class
2) .class_addIvar-- instance variables for this class add
3) .sel_registerName-- register a SEL method
4) .class_addMethod-- class added dynamically created method
5) .objc_registerClassPair-- created registered class
6) .class_getInstanceVariable-- acquired class instance variables
7) .object_setIvar-- of object variable assignment
8) .objc_disposeClassPair-- destruction created out of class
----------------
Disclaimer: This article is the original article CSDN bloggers "CINNS", and follow CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
Original link: https: //blog.csdn.net/nvlangxin/article/details/51610818

Guess you like

Origin www.cnblogs.com/feng9exe/p/11460994.html