App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure
Xcode7 ,HelloOS,当初次学习Swift时编码完毕,run 时,涉及到了访问http资源,,在console 里面的消息如下:
2016-07-26 01:45:39.712 L11HelloOS[2630:122784]
App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure.
Temporary exceptions can be configured via your app's Info.plist file.
原因:
Xcode 7, 涉及到了访问http资源,测试时碰到如下报错:
App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure.
新特性要求App内访问网络请求,要采用 HTTPS 协议。但是我获取服务器资源都是HTTP协议,经过查找资料最终找到以下解决办法:
解决方法:
打开 工程主目录下info.plist
增加属性字典 App Transport Security Settings
在这个属性下增加节点 Allow Arbitrary Loads, value 为 YES
本文链接二维码可以保存在本地:保存
http://shixiangcun.cc/index.php?c=index&id=52&m=articleDetailInfo
分类 Swift | 浏览 (3602) | 赞 (0) | 踩 (0) | | 2016-07-26 09:15:51 |
相关文章