アプリの UICollectionView に (インターネットからの) 写真のサムネイルを表示しています。あまりにも多くの (20 以上のような) 解像度の高い画像があると、アプリは単純にクラッシュします。メモリ管理に関しては、私は一種のアマチュアです。私の質問は、メモリ管理または画像のスケーリングを介してこの問題を解決する必要があるかどうかです (そうすると、画像が UIViewContentModeScaleAspectFill にないのではないかと疑われます)。
現在、 SDWebImageを使用して画像をロードしています。
- (UICollectionViewCell*)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"thumbCell" forIndexPath:indexPath];
NSString *URL = [self.album.imageURLs objectAtIndex:(indexPath.item+1)];
UIImageView *iv = [[UIImageView alloc] initWithFrame:CGRectMake(80, 80, 277, 58)];
iv.backgroundColor = [UIColor clearColor];
iv.opaque = NO;
iv.contentMode = UIViewContentModeScaleAspectFill;
[iv setImageWithURL:[NSURL URLWithString:URL]];
cell.backgroundView = iv;
return cell;
}