https://www.jianshu.com/p/66b366ed850e
https://www.jianshu.com/p/872447c6dc3f
@implementation NSObject (loadAndInitial)
+ (void)initializeAndLog {
NSLog(@"**out- %s %@",__func__,[self class]);
[self initializeAndLog];
}
+ (void)load{
NSLog(@"%s",__func__);
Method method1 = class_getClassMethod([self class], @selector(initialize));
Method method2 = class_getClassMethod([self class], @selector(initializeAndLog));
//交换method1和么thod的IMP指针,(IMP代表了方法的具体的实现)
method_exchangeImplementations(method1, method2);
}