1

我的程序之一是使用SDWebImage. 现在我有一个从服务器下载 webp 图像并保存在沙箱中的功能。但我不知道如何使用SDWebImage在沙箱中读取 webp 图像。显示界面。

我尝试了以下方法:

[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;

               }];

但是错误...

所以我该怎么做...?

4

0 回答 0