In my iPhone app I have a very long table which I am loading from xml (online xml). This table shows one image and some text data in a row. I am also using Lazy Loading to load image. Now in instruments there is no serious leaks, but overall memory allocation raising as I scrolling the table to down (means loading new images).
I want to know will this cause app crashing? My client is saying that the app is crashing on 3GS and iPhone 4, I am testing app on iPod 4G. I am not seeing any crashes but I can see high memory allocations in Instruments.
Please Help!
update -
Yes I am using resuable Cells. When the image loads I add them into the cells using this code -
- (void)appImageDidLoad:(NSIndexPath *)indexPath
{
IconDownloader *iconDownloader = [imageDownloadsInProgress objectForKey:indexPath];
if (iconDownloader != nil)
{
UITableViewCell *cell = (UITableViewCell *)[tblView cellForRowAtIndexPath:iconDownloader.indexPathInTableView];
// Display the newly loaded image
UIImageView *mixtapeImage = (UIImageView *) [cell viewWithTag:TAG_IMAGE];
mixtapeImage.image = iconDownloader.appRecord.mixtape_image_obj;
}
}
You are right that i am not releasing the image because if I scroll up the table I have to add images in cells again thats why I am caching them in "imageDownloadsInProgress" dictionary.
Is there more efficient way of doing this?
The issue could very well be the images being cached, in which case the best solution would be to remove some images from the cache when you get a low memory warning. You could possibly write them to disk temporarily, which would provide a faster load time next time they're needed than re-downloading.