Xcode 7.0也就是iOS9.0中开发要求App内访问的网络必须使用HTTPS协议。那么我们公司没用采用https怎么办?如果发现网络请求失败,Xcode后台报错信息为:
The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.
解决方法:
在Info.plist中添加NSAppTransportSecurity类型Dictionary。
在NSAppTransportSecurity下添加NSAllowsArbitraryLoads类型Boolean,值设为YES
<key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict>
我在AppStroe上传了个APP叫《今日便签》,完美高仿鼎鼎大名的Clear,不仅免费还添加了许多新的功能,使用更爽更简洁,欢迎各位下载使用 : )