我检查了一些这方面的答案,但这是我的代码特有的,我无法让它工作。有什么想法吗?
错误从
开始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
}
}];
答案 0 :(得分: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