I am using SDWebImage Library for caching and Lazy loading. But I found that sometime it is showing Image of another cell.
Detail Scenerio
- There is CollectionView having cells containing UIImageView and Labels.
- ImageView contains the Image of Users and label with their
names.
But sometimes The Image loaded in the Imageview Have the different image.
Lets say
Index Name Image
0 nameA A
1 nameB B
2 nameC C
3 nameD B
So here As at index have nameD so image should b "D" but it is displaying Image of nameB i.e. "B"
This is the Code i used
if ([aMutDict objectForKey:@"picture_url"])
{
[[SDWebImageManager sharedManager]downloadWithURL:[NSURL URLWithString:[aMutDict objectForKey:@"picture_url"]] options:SDWebImageProgressiveDownload progress:Nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished) {
if(image){
[cell.imgProfilePic setImage:image];
}else{
[cell.imgProfilePic setImage:ApplicationDelegate.gblImgPlaceholder];
}
}];
}