I'm using SDWebImageDownloader to download an image and then show it on a cell, but I have the issue that if the image doesn't finish download once the view is unloaded, it causes that my app crashes.
I'm using the code that is provided on the github page:
[SDWebImageDownloader.sharedDownloader downloadImageWithURL:imageURL
options:0
progress:^(NSInteger receivedSize, NSInteger expectedSize)
{
// progression tracking code
}
completed:^(UIImage *image, NSData *data, NSError *error, BOOL finished)
{
if (image && finished)
{
// do something with image
}
}];
And in this github issue, a user says that this method returns a SDWebImageOperation, which can be cancelled, but I couldn't find a way to do cancel all the operations on the shared downloader.