SDWebImage can load the sandbox picture?

123 views Asked by At

One of my programs is to load webp image with SDWebImage. Now I have a feature that downloads a webp image from the server and save in the sandbox. But I don't know how to use SDWebImage to read a webp image in sandbox. Display interface.

I tried the following:

[self.img1 sd_setImageWithURL:
      [NSURL fileURLWithPath:[cachesDir stringByAppendingPathComponent:
                             [NSString stringWithFormat:@"JsonCache"]]]//local picture
            placeholderImage:img
                      options:SDWebImageLowPriority
                     progress:^(NSInteger receivedSize, NSInteger expectedSize) { 
                }
                     completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {

                   self.img1.image = image;

               }];

but error...

So what should I do...?

0

There are 0 answers