91枚の画像の画像をキャッシュしたい。そして、すべての画像は約50MBです。たくさんのメモリが使い果たされているようです。
私のコードはここにあります。効率的なメモリのための最良の方法は何ですか?
lG2Image[0] = [[UIImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"background" ofType:@"png"]];
lG2Image[1] = [[UIImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"myimage1" ofType:@"png"]];
lG2Image[2] = [[UIImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"myimage2" ofType:@"png"]];
...
UIImageView* tmp;
for (int i=0; i<91; i++) {
tmp = [[UIImageView alloc] initWithImage:lG2Image[i]];
[_window addSubview:tmp];
[tmp removeFromSuperview];
tmp = nil;
}