문제

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?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top