I am using custom UITableView
cell in my app and i had integrated LazyTableImages sample code to download image in tableview. I am using the below code in
- (void)appImageDidLoad:(NSIndexPath *)indexPath
{
IconDownloader *iconDownloader = [imageDownloadsInProgress objectForKey:indexPath];
if (iconDownloader != nil)
{
CustomTblViewCell *cell = (CustomTblViewCell *)[self.TblView cellForRowAtIndexPath:iconDownloader.indexPathInTableView];
// Display the newly loaded image
cell.ImgViewUser.image = iconDownloader.appRecord.m_strImage;
}
// Remove the IconDownloader from the in progress list.
// This will result in it being deallocated.
[imageDownloadsInProgress removeObjectForKey:indexPath];
[m_CtrlTblViewFacetoface reloadData ];
}
The above code is not loading any data but when i used the UITableView
cell instead of Customcell then it is working, Any idea?
simply there is a library I used it before and it worked well this library called " SDWebImage " you can use it simply by a method:
[cell.ImgViewUser setImageWithURL:[NSURL URLWithString:@"http://www.domain.com/path/to/image.jpg"]
placeholderImage:[UIImage imageNamed:@"placeholder.png"]];
and it cache images automatically and it support loading only from cache (if you need) and handle memory warning automatically .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.