标签:
#import "UIImage+image.h"
#import <objc/runtime.h>
@implementation UIImage (image)
+(void)load
//只要分类被装载到内存中 就会被调用一次
{
Method ohter=class_getClassMethod([UIImage class], @selector(imageWithName:));
Method origin = class_getClassMethod([UIImage class], @selector(imageNamed:));
method_exchangeImplementations(ohter, origin);
}
+(UIImage*)imageWithName:(NSString*)name{
NSLog(@"=====");
[UIImage imageWithName:name];
return nil;
}
标签:
原文地址:http://www.cnblogs.com/xiezefeng/p/5781891.html