+(void)load
{
#ifdef DEBUG
MethodviewwillAppear=class_getInstanceMethod(self,@selector(viewWillAppear:));
MethodlogViewWillApear=class_getInstanceMethod(self,@selector(logViewWillAppear:));
method_exchangeImplementations(viewwillAppear, logViewWillApear);
#endif
}
-(void)logViewWillAppear:(BOOL)animated
{
NSString*classname =NSStringFromClass([selfclass]);
//过滤条件,指定打印条件
if([classnamehasPrefix:@""] ==NO) {
NSLog(@"%@ will appear",classname);
}
[selflogViewWillAppear:animated];
}