iPhone SDK: SDWebImageDownloader Crashing
-
12-12-2019 - |
문제
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_ACCESS
when you try to send a message to delegate
, it's likely that delegate
is a dangling pointer because it's being released prematurely. What is retaining delegate
? What is releasing delegate
?
제휴하지 않습니다 StackOverflow