美文网首页
IOS使用SDWebImage报错解决方案

IOS使用SDWebImage报错解决方案

作者: 水_水 | 来源:发表于2016-04-12 18:03 被阅读1165次

[imageView setImageWithURL:[NSURL URLWithString:IMAGE_URL]];

会报错:“App TransportSecurity has blocked a cleartext HTTP (http://) resource load since it isinsecure. Temporary exceptions can be configured via your app's Info.plistfile.”

解释:ATS禁止HTTP明文传输,因为不安全。

解决方案:修改Info.plist文件,让它临时允许明文传输。

在Info.plist文件中添加"App Transport Security Settings", Type为"Dictionary",再添加"Allow Arbitrary Loads", Type 为"Boolean",“Value”为“YES”即可。

相关文章

网友评论

      本文标题:IOS使用SDWebImage报错解决方案

      本文链接:https://www.haomeiwen.com/subject/svlwlttx.html