@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);
}