gpt4 book ai didi

ios - 不兼容的 block 指针类型 SDWebImage

转载 作者:行者123 更新时间:2023-12-01 19:12:34 26 4
gpt4 key购买 nike

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

错误开始于

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);

所以看起来你错过了 finished BOOL

关于ios - 不兼容的 block 指针类型 SDWebImage,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15484136/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com