allocations before running \'extra loop\'
The code:
The problem was that UIImage usually keeps just a ref(CGImageRef), which is a small one. After displaying items, CGImageRef was 'injected' with information. As a result the table was growing all the time.
The simple but not the most beautiful solution was to use the code:
NSArray = @[obj1, obj2, obj3]; // where obj is custom NSObject and has a UIImage property
instead of:
NSArray = @[img1, img2, img3]; // where img is of UIImage type
Wrap in @autorelease
pool?
Also, why are you setting the image for veryTemp (I assume it's a UIImageView
) 800 times in [veryTemp setImage:coverImage];
?
Finally:
[_albumCovers objectAtIndex:indexPath.row];
You're getting the image object at the exact same index (indexPath.row
) in your loop. I am not quite sure what you're trying to achieve in your code?