0

I am trying to use SDWebImage library to download in efficiency images. I use to download 10 photos at the same time in serial order (the function downloadWithURL create a thread for every request). sometimes with specific urls the function is like stacking in infinite loop. neither success callback is called nor error. I know im using not the newest version of the library but I guess its strange that the bug is there.

my code looks like this:

SDWebImageManager *manager = [SDWebImageManager sharedManager];

[manager downloadWithURL:[NSURL URLWithString:self.imageURL] 
  delegate:self
  options:SDWebImageRetryFailed
  success:^(UIImage* image)
   { NSLog(@"downloaded successful"); }
  failure:^(NSError* error)
   { NSLog(@"downloaded failure"); }];
TalP
  • 59
  • 7

1 Answers1

0

Just add BOOL completed in success brackets, and then it will work like a charm...

    SDWebImageManager *manager = [SDWebImageManager sharedManager];

[manager downloadWithURL:[NSURL URLWithString:self.imageURL] 
  delegate:self
  options:SDWebImageRetryFailed
  success:^(UIImage* image,BOOL Completed)
   { NSLog(@"downloaded successful"); }
  failure:^(NSError* error)
   { NSLog(@"downloaded failure"); }];
Irfan Anwar
  • 1,878
  • 17
  • 30