シンプルなシナリオ:5.000行のテーブルビューコントローラ。 私は0.pngから4999.pngの5000画像名を持っています。ここでios tableviewイメージでメモリが解放されない
は私cellForRowAtIndexPathです:メソッド:
静的NSStringの* CellIdentifier = @ "セル";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
NSString *string = [NSString stringWithFormat:@"%d",indexPath.row];
UIImage *img = [UIImage imageNamed:string];
if (img) {
cell.imageView.image = img;
} else {
cell.imageView.image = [UIImage imageNamed:@"NoPhotoDefault"];
}
return cell;
私は行動の聖霊降臨祭の楽器をanalizedてきたが、それは本当のメモリ使用量がスクロールで速く上昇していると、それがダウンしたことがないことを示しています。
最後の行に達すると約8 MBから始まり200 MBになります。
ここには何が欠けていますか?
ありがとう
P.S. Proj base sdkは5.0で、ARCを使用します。
後でアプリをバックグラウンドで送信すると、メモリが解放されます。
すでに回答があります。[こちら](http://stackoverflow.com/questions/6792000/image-caching-in-ios) – Alladinian