SDWebImage库只加载两个图像

时间:2015-03-05 09:06:57

标签: ios image caching imageview sdwebimage

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

代码是:

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;


     }
 }];

1 个答案:

答案 0 :(得分:1)

方法名称是更改

使用此方法

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