/ Published in: Objective C
Expand |
Embed | Plain Text
UIImageViewで画像を使うとき、下記のようにimageNamedを使って画像ファイルを読み込むとキャッシュされるので、メモリリークとなることがある。 UIImageView *imageView = [[UIImageView alloc] initWithImage:image]; 代替策として、dataWithContentsOfFileを使うとキャッシュを使わずに画像を表示することができる。 UIImage *image = [UIImage imageWithData:imageData]; UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
You need to login to post a comment.
