SDWebImage: Is there a BUG that sd_setImageWithURL completed with a wrong image?
[aActionIV sd_setImageWithURL:tryURL
placeholderImage:holderImg
options:SDWebImageRetryFailed | SDWebImageLowPriority
progress:^(NSInteger receivedSize, NSInteger expectedSize)
{
if (expectedSize > 0)
{
float progress = receivedSize / (float)expectedSize;
[loadingIndicator setProgress:MAX(MIN(1, progress), 0) animated:YES];
}
}
completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL)
{
[loadingIndicator removeFromSuperview];
if (error)
{
NSLog(@"%@", error);
}
else
{
}
}];
I have some UIImageView that using sd_setImageWithURL
to load images.
But after pod update
SDWebImage to 3.7.2
, sometimes one UIImageView will show wrong image that belongs to other URL.
Just like two UIImageView exchange their images. And when I change SDWebImage to 3.7.1
, everything is OK.
So weird!
Now the question,
Is there a BUG that sd_setImageWithURL completed with a wrong image?
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 31 (10 by maintainers)
Well, my solution also worked. 😃 - I don’t think it should be necessary though. I’d expected SDWebImage to cancel the previous download if I start a new one on the same UIImageView (or is there a case where you wouldn’t want to have this behavior?). The solution with manually resetting works good in general I think. Would need to mention it in the docs (even if it’s only until it is fixed).
I think this is what happend in my case:
But again, I don’t think it’s super urgent to fix this since the workaround works pretty good even without accessing the source.