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?
i have got two questions about LazyTableImages(namely RootViewController.m) by Apple
- (void)appImageDidLoad
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
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?