1

I'm using the following code to lazy load an image into my UIImageView:

[self.imv1 setImageWithURL:[NSURL URLWithString:myURL]
              placeholderImage:[UIImage imageNamed:@"loading.png"]
                     completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType)
     {
         // stuff here
     }];

When a user touches a button, I want the lazy loading of this to STOP completely, so that no image gets loaded and the download of the image stops.

After I stop the lazy loading, I plan to load a different image into the same UIImageView.

Is this possible with SDWebImage?

Ethan Allen
  • 14,425
  • 24
  • 101
  • 194
  • I don't know the library, but it seems unlikely from the method signature. You'd need to get its NSURLConnection object, which it seems the library is designed to hide that, sparing you the complexity. Can you relax your requirement that the load stops altogether? How about just let that request go to waste and set the different image? – danh Jun 12 '13 at 19:04

1 Answers1

2

Found out how to do it. I just needed to call this:

[self.imv1 cancelCurrentImageLoad];
Ethan Allen
  • 14,425
  • 24
  • 101
  • 194