ios - SDWebImage 库只加载两个图像

标签 ios image caching imageview sdwebimage

我正在使用 SDWebImage 库来缓存 UICollectionView 的图像,该图像是从 url 下载的,每次发送所有请求但只下载两个图像。有谁知道原因吗???提前致谢。

代码是:

SDWebImageManager *manager = [SDWebImageManager sharedManager];
[manager downloadWithURL:[NSURL URLWithString:[fileimagepath objectAtIndex:indexPath.row]]
                 options:0
                progress:nil
               completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished)
 {

     if (image == nil)
     {

         NSLog(@"image Not received");
     }
     else
     {
         cell.imageview.image = image;


     }
 }];

最佳答案

方法名已更改

用了这个方法

- (id<SDWebImageOperation>)
    downloadImageWithURL:(NSURL *)url
                 options:(SDWebImageOptions)options
                progress:
                    (__strong SDWebImageDownloaderProgressBlock)progressBlock
               completed:(__strong SDWebImageCompletionWithFinishedBlock)
    completedBlock;

关于ios - SDWebImage 库只加载两个图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28873826/

相关文章:

ios - Xcode 8 : aps-environment is missing from the archived app

javascript - 在 jQuery 中预缓存不同数量的图像,如果所有图像都已加载则回调

javascript - 抑制 Safari 中的图像加载错误

internet-explorer - 使用后退按钮: IE and Safari not reading from cache whereas Firefox and Chrome do

ios - 如何在沙盒环境中使用测试用户取消自动续订订阅?

ios - JSON页面仅访问第一页xcode

iOS >> 拖动 View 跳回原始位置 >> Auto Layout 结合 UIPanGestureRecognizer 问题

javascript - ReactJS,在 <img> 标签中呈现 base64 字符串给出错误 ERR_INVALID_URL

为文件实现伪缓存系统的 PHP 方法

caching - 维护包含 ESI 的请求的 session