UIImage用imageNamed的内存有关问题
UIImage用imageNamed的内存问题
@implementation UIImage(imageNamed_Hack)
+ (UIImage *)imageNamed:(NSString *)name {
NSString *path = [NSString stringWithFormat:@"%@/%@",
[[NSBundle mainBundle] bundlePath],
name];
return [UIImage imageWithContentsOfFile:path];
}
@end
@implementation UIImage(imageNamed_Hack)
+ (UIImage *)imageNamed:(NSString *)name {
NSString *path = [NSString stringWithFormat:@"%@/%@",
[[NSBundle mainBundle] bundlePath],
name];
return [UIImage imageWithContentsOfFile:path];
}
@end