0
我正在制作iPad杂志,并且使用了大量图像(背景,幻灯片和动画),并且使用的内存非常高。图像优化(iOS)
我读过下面的方法使用了大量的内存
UIImage *picture = [UIImage imageNamed:@"myFile.png"];
他们建议使用这一个
NSString *fullpath = [[[NSBundle mainBundle] bundlePath] stringByAppendingString:@"/myFile.png"];
imageView.image = [UIImage imageWithContentsOfFile:fullpath];
但我发现了另一个方法以及
imageView.image = [[UIImage alloc] initWithContentsOfFile: [[NSBundle mainBundle] pathForResource:@"myFile" ofType:@"png"]];
为了优化我的应用程序,我应该使用哪种方法?我的所有图像都是.jpg,并保存为Photoshop中的网页。
更好的管理“我读过下面的方法使用的内存了很多”是不正确的本身。另外,这与Xcode无关。 – 2013-12-11 14:14:42