ios 编程日记 1 :内存问题 补充

来源:互联网 发布:医疗网络咨询技巧 编辑:程序博客网 时间:2024/06/13 18:04
  • 1、imageName:,这个方法一定要少用,能不用就不用。那用什么方法?

initWithContentsOfFile这个方法:

NSString * filePath = [NSString stringWithFarmt:@"%@/%@",[[NSBundle mainBundle] recourcePath],@"1.png"];

[UIImage alloc] initWithContentsOfFile:filePath]