Ios 通过SdWebImage设置图像会得到“;错误代码=-1003”;并使用CFNetwork Diagnostics log“;错误(-65554)";
使用Ios 通过SdWebImage设置图像会得到“;错误代码=-1003”;并使用CFNetwork Diagnostics log“;错误(-65554)";,ios,objective-c,uitableview,nsurlconnection,sdwebimage,Ios,Objective C,Uitableview,Nsurlconnection,Sdwebimage,使用SDWebimage块生成tableCell的图像部分: [cell.i_imageView sd_setImageWithURL:[NSURL URLWithString: item.imageUrl] placeholderImage:[UIImage imageNamed:@"no-image"] options: SDWebImageRefreshCached completed:^(UIImage * _Nullable image, NSE
SDWebimage
块生成tableCell的图像部分:
[cell.i_imageView
sd_setImageWithURL:[NSURL URLWithString: item.imageUrl]
placeholderImage:[UIImage imageNamed:@"no-image"]
options: SDWebImageRefreshCached
completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
if(!image)
NSLog(@"image not loaded %@", error.description);
在大多数情况下,映像可以正常加载,但有时在SDwebimage的完成处理程序中,当映像失败时,它会给出这些错误消息“error code=-1003”,在使用CFNetwork Diagnostics log时,它会给出“Err(-65554)”
经过大量研究,我发现这是一个与DNS相关的问题,并使用以下方法验证了这一理论
- 在实际设备上使用VPN
- 断开WIFI连接并使用手机数据
对于上述这些技术,图像会再次重新加载,但我不能在交付产品时押注于上述两种方法,因此,任何NSURLSession调用,SdWebImage方法,我可能会在这里遗漏,以解决问题,或者,可能有一种方法可以为这些特定的URL打开手机数据,结果是使用Cooperative Wifi ISP的问题,该ISP对一些经过测试的URL有保留,唯一需要的是重新连接到新的不同Wifi或使用手机
它从未与SDWebimage相关-1003是NSURErrorCannotFindHost错误。没有internet连接时出现的常见错误。我确信设备具有稳定的连接