加载图片时 使用之后存放在缓存中,直到程序关闭
[UIImage imageWithData:[NSData dataWithContentsOfFile]
//以下方法效率高 都不一直在缓存中存在
[UIImage imageWithContentsOfFile:imagePath];
//此方法使用立即释放 - 关于创建对象,以后尽量使用系统的减号方法
//读取应用程序缓存
[UIImage alloc] initWithContentsOfFile:imagePath];
//读取应用程序安装文件缓存
NSString *imagePath = [[NSBundle mainBundle] pathForResource:[self.imageNameArray objectAtIndex:indexPath.row] ofType:@".png"];
cell.imageView.image =[UIImage imageWithContentsOfFile:imagePath];