iOS9引入了新特性App Transport Security (ATS)。
新特性要求App内访问的网络时,必须使用HTTPS协议。
但是以前很多的api都是http协议,没法一次性全部更新,为了解决这个问题,需要做如下配置
Xcode7(这个是从网上爬来的,现在我也没用7了)
在Info.plist中add Row添加NSAppTransportSecurity类型Dictionary。
在NSAppTransportSecurity下添加NSAllowsArbitraryLoads类型Boolean,值设为YES
Xcode7.1+
在Xcode7.1中苹果更改了配置
Project(你的项目)–> Info –> App Transport Security Settings
在App Transport Security Settings下添加Allows Arbitrary Loads类型Boolean,值设为YES
当xcode为7.1+,填写xocde7上的关键字 会自动修改。