Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/file/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c UIPageViewController&;SDWebImage-远程映像时显示错误映像';没有_Objective C_Uipageviewcontroller_Sdwebimage - Fatal编程技术网

Objective c UIPageViewController&;SDWebImage-远程映像时显示错误映像';没有

Objective c UIPageViewController&;SDWebImage-远程映像时显示错误映像';没有,objective-c,uipageviewcontroller,sdwebimage,Objective C,Uipageviewcontroller,Sdwebimage,我正在将UIPageViewController与SDWebImage结合使用,以便在不进行缩放的情况下显示图像库 我从远程获取图像,有时由于URL错误而导致某些图像无法下载 我想在远程映像未下载时显示一个错误映像 有人知道或建议我怎么做吗?我试着环顾谷歌,但没有成功 提前感谢。在自定义SDWebImageCompletionBlock中设置自己的errorImage: [imageView sd_setImageWithURL:url placeholderImage:placeholde

我正在将UIPageViewController与SDWebImage结合使用,以便在不进行缩放的情况下显示图像库

我从远程获取图像,有时由于URL错误而导致某些图像无法下载

我想在远程映像未下载时显示一个错误映像

有人知道或建议我怎么做吗?我试着环顾谷歌,但没有成功


提前感谢。

在自定义
SDWebImageCompletionBlock
中设置自己的
errorImage

[imageView
 sd_setImageWithURL:url
 placeholderImage:placeholderImage
 options:options
 progress:NULL
 completed:^(UIImage * image,
             NSError * error,
             SDImageCacheType cacheType,
             NSURL * imageURL)
 {
     if (error)
     {
         imageView.image = errorImage;
     }
 }];

就这样。谢谢你,伙计!我一给你赏金你就可以拿到赏金赏金被放在被接受的答案之前。我忘了给你,tho。