您的位置:首页 > 理论基础 > 计算机网络

Xcode7中网络连接异常的问题

2015-09-17 17:51 561 查看
https://developer.apple.com/library/prerelease/ios/releasenotes/General/WhatsNewIniOS/Articles/iOS9.html#//apple_ref/doc/uid/TP40016198-DontLinkElementID_13

在iOS9 中,苹果将原http协议改成了https协议,使用 TLS1.2 SSL加密请求数据。

解决办法:

在info.plist中添加:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>

具体方法:显示原码的方式打开
info.plist,加入如下设置:

<plist>

<dict>

....

<key>NSAppTransportSecurity</key>

<dict>

<key>NSAllowsArbitraryLoads</key>

<true/>

</dict>

</dict>

</plist>

即可解决。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: