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

在Xcode7中,苹果默认仅支持HTTPS,不再支持HTTP。若应用涉及到HTTP资源访问,将导致加载失败并提示安全错误。解决办法是在工程主目录下的info.plist文件中增加AppTransportSecuritySettings属性字典,并设置AllowArbitraryLoads为YES。
799

被折叠的 条评论
为什么被折叠?



