Xcode 7, 涉及到了访问http资源,测试时碰到如下报错:
App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure.
原因:
在Xcode7中,苹果默认只支持https,不在支持http
解决方法:
打开 工程主目录下info.plist
增加属性字典 App Transport Security Settings
在这个属性下增加节点 Allow Arbitrary Loads, value 为 YES
![App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. - 牛牛 - 牛牛的博客](http://img2.ph.126.net/uC5n-6XsoUwpLtKBwP6QgQ==/6631391022119895404.png)