使用Xcode 7测试,iOS 9应用程序无法从http请求获取数据 [英] With Xcode 7 testing an iOS 9 app is unable to obtain data from a http request

查看:100
本文介绍了使用Xcode 7测试,iOS 9应用程序无法从http请求获取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在iOS中开发一个应用程序。对于我的开发,我使用的是Xcode beta7。之前,我曾经在iOS 8.4中使用iOS 8.4在我的手机中测试我的应用程序,在更新到iOS 9之后,我无法在我的手机中安装相同的应用程序。请给我一些建议。非常感谢!

I am developing an application in iOS. For my development I am using Xcode beta7. Before, I used to test my app in my mobile with iOS 8.4 after updating to iOS 9, I can't install the same app in my mobile. Please give me some suggestions. Big thanks!

推荐答案

将此行添加到.plist文件中:

Add this line to your .plist file:

如果只使用一个域,则将其添加到.plist中:

If just one domain is used then add this into your .plist:

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSExceptionDomains</key>
    <dict>
        <key>yoursite.com</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
            <true/>
        </dict>
    </dict>
</dict>

目前这只是一种解决方法,但我几周后就已经通过App Store批准了。

This is currently just a workaround but I had it approved by the App Store a few weeks back.

这篇关于使用Xcode 7测试,iOS 9应用程序无法从http请求获取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆