升级Xcode7.0 bata发现网络请求访问失败

输出的错误信息:

The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.
IOS9引入了新特性 App Transport Security (ATS),详情:App Transport Security (ATS)
新特性要求APP内访问的网络必须使用HTTPS协议。
现在公司的项目使用的是HTTP协议,使用私有加密方式保证数据的安全。现在也不能马上改成HTTPS协议传输。
问题解决

1、在Info.plist中添加NSAppTransportSecurity类型Dictionary

2、在NSAppTransportSecurity下添加NSAllowsArbitraryLoads类型Boolean,值设为YES
如图



posted on 2015-10-29 16:50  强者VS弱者  阅读(149)  评论(0编辑  收藏  举报