1

我检查了一些答案,但这特定于我的代码,我无法让它工作。有什么想法吗?

错误开始于

completed:^(UIImage *image, NSError *...

完整代码

//Load from URL
        NSURL *url =[NSURL URLWithString:image.imageURL];


        SDWebImageManager *manager = [SDWebImageManager sharedManager];

        [manager downloadWithURL:url
                         options:0
                        progress:^(NSUInteger receivedSize, long long expectedSize)
         {
             // progression tracking code
         }
                       completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType)
         {
             if (image)
             {
                 // do something with image
             }
         }];
4

1 回答 1

3

SDWebImageManager标头中,该方法被声明为:

- (id<SDWebImageOperation>)downloadWithURL:(NSURL *)url
                                   options:(SDWebImageOptions)options
                                  progress:(SDWebImageDownloaderProgressBlock)progressBlock
                                 completed:(SDWebImageCompletedWithFinishedBlock)completedBlock;

SDWebImageCompetedWithFinishedBlock声明如下:

typedef void(^SDWebImageCompletedWithFinishedBlock)(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished);

所以看起来你错过了finished BOOL

于 2013-03-18T18:53:11.923 回答