I’m using the SDWebImageDownloader library to download images asynchronously.
The problem i’m having is when I click the back button before the images finish download the app is crashing on the following line in the SDWebImage Class:
if([delegate respondsToSelector:@selector(imageDownloaderDidFinish:)])
This is how i’m using it in my code:
sdDownloader = [[SDWebImageDownloader downloaderWithURL:headerImgURL delegate:self]retain];
What is causing it to crash? I’m retaining it and i’m not releasing it anywhere.
When you say you are retaining “it”, what do you mean by “it”? If it’s crashing with
EXC_BAD_ACCESSwhen you try to send a message todelegate, it’s likely thatdelegateis a dangling pointer because it’s being released prematurely. What is retainingdelegate? What is releasingdelegate?