//方法交换
- (void)awakeFromNib
{
Method one =class_getInstanceMethod([selfclass], NSSelectorFromString(@"viewDidLoad"));
Method two =class_getInstanceMethod([selfclass], @selector(customViewDidLoad));
method_exchangeImplementations(one, two);
NSLog(@"!");
}
- (void)viewDidLoad {
[superviewDidLoad];
NSLog(@"%s",__func__);
// Do any additional setup after loading the view, typically from a nib.
}
- (void)customViewDidLoad{
NSLog(@"%s",__func__);
[selfcustomViewDidLoad];
}