使用以下方式生成图像调用:
[cell.i_imageView sd_setImageWithURL:[NSURL URLWithString: item.PostimageUrl] placeholderImage:[UIImage imageNamed:@""] options: SDWebImageRefreshCached progress:nil completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
if(!image)
NSLog(@"image not loaded %@", error.description);
在大多数情况下,图像可以很好地加载,但在某些情况下,sdwebimage会出现此错误 “找不到具有指定主机名的服务器” 。
经过大量研究,我发现这是一个与DNS相关的问题,并通过以下方法对这一理论进行了验证,
图像加载到的位置很好。但是我在产品出厂时不能将上述两种方法都押在上面,因此我想解决此问题的任何workaround
或任何SdWebImage
方法都没有。