I'm showing thumbnails of pictures (from the internet) in a UICollectionView in my app. When there are too many (like 20+) and too high res'd images the app simply crashes. I'm sort of an amateur when it comes to memory management. My question is if I should solve this problem via memory management or scaling the images somehow (if I do that I'm suspecting the images won't be in UIViewContentModeScaleAspectFill)?
Right now I'm using SDWebImage to load my images.
- (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;
}