Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Howiieque

macrumors regular
Original poster
Feb 1, 2009
120
0
hello everybody,
i have got two questions about LazyTableImages(namely RootViewController.m) by Apple

- (void)appImageDidLoad:(NSIndexPath *)indexPath {
1. there is a condition test to verify whether the iconDownloader is not nil. but i think it is exactly that the iconDownloader with corresponding index path calls back this method, so it would not nil.

2. once this method is called, it means that iconDownloader finishes its job. so i think iconDownloader can be release now and be removed from the imageDownloadsInProgress(mutable dictionary). as the name implies, the dictionary should only store the downloader in progress. and for memories' sake, the finishing downloader should also be removed.
}

- (void)startIconDownload:(AppRecord *)appRecord forIndexPath:(NSIndexPath *)indexPath {
in this method, there also a condition if to test whether the downloader exists. if it has already existed, it would get ignored. let us suppose that one iconDownloader encounters error and never gets released(it seems that the downloaders will not be released in the sample code). so when this method gets called for the second time with the same index path, it will do nothing. so it means once the download for one icon encounters error, it will not has a chance to get it later.
}

Apple has so many experienced programmers, and it is very likely that i did not fully understand this example. would somebody answer my questions, please?
 
and i also found out that if the app receive memory warning, it will crash.
 
Did you ever figure this out. I think I'm having the same problem with the imageDownloadsInProgress not releasing finished IconDownloaders
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.