IOS使用SDWebImage报错解决方案

[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报错解决方案)