不兼容的块指针typesSDWebImage
我检查了一些答案,但这是特定于我的代码,我不能得到这个工作。 有什么想法吗?
错误始于
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 } }];
从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);
所以看起来你错过了BOOL