有缓存
UIImage *image = [UIImage imageNamed:@"a.png"];
无缓存
NSString *path = [[NSBundle mainBundle] pathForResoure:@"a.png" ofType:nil];
UIImage *image = [UIImage imageWithContentsOfFile:path];
本文共 241 字,大约阅读时间需要 1 分钟。
有缓存
UIImage *image = [UIImage imageNamed:@"a.png"];
无缓存
NSString *path = [[NSBundle mainBundle] pathForResoure:@"a.png" ofType:nil];
UIImage *image = [UIImage imageWithContentsOfFile:path];
转载于:https://www.cnblogs.com/qingpeng/p/3749051.html