Xcode 7 支持http请求info.plist设置

来源:互联网 发布:linux 硬盘同步 编辑:程序博客网 时间:2024/06/13 18:00

  由于iOS9改用更安全的https,为了能够在iOS9中正常使用http发送网络请求,请在"Info.plist"中进行如下配置,否则影响SDK的使用。

1.找到项目中的 Info.plist 文件,右击,选择 open as ------>source code.

2.在打开的文件中光标定位倒数第二行。将下放的内容复制进去。

<key>NSAppTransportSecurity</key>

    <dict>

        <key>NSAllowsArbitraryLoads</key>

        <true/>

    </dict>



或者:

<key>UISupportedInterfaceOrientations~ipad</key>

<array>

<string>UIInterfaceOrientationPortrait</string>

<string>UIInterfaceOrientationPortraitUpsideDown</string>

<string>UIInterfaceOrientationLandscapeLeft</string>

<string>UIInterfaceOrientationLandscapeRight</string>

</array>

    <key>NSAppTransportSecurity</key>

    <dict>

        <key>NSAllowsArbitraryLoads</key>

        <true/>

    </dict>

3.command +S 保存。

4.OK。

0 0
原创粉丝点击