Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Can';t使用swift 2在IOS9上的webview中加载http授权网站url_Ios_Swift_Webview_Uiwebview - Fatal编程技术网

Can';t使用swift 2在IOS9上的webview中加载http授权网站url

Can';t使用swift 2在IOS9上的webview中加载http授权网站url,ios,swift,webview,uiwebview,Ios,Swift,Webview,Uiwebview,我现在正在进行IOS开发,遇到一个问题,我无法在webview中加载http授权站点,它只显示空白页面,没有显示任何内容,下面是我加载网站的代码: @IBAction func testhttp(sender: AnyObject) { let url = NSURL(string: "http://www.obee.com.au/demo/admin/index.php"); let request = NSURLRequest(URL: url!); //see2

我现在正在进行IOS开发,遇到一个问题,我无法在webview中加载http授权站点,它只显示空白页面,没有显示任何内容,下面是我加载网站的代码:

@IBAction func testhttp(sender: AnyObject) {

    let url = NSURL(string: "http://www.obee.com.au/demo/admin/index.php");
    let request = NSURLRequest(URL: url!);
    //see2 is the webview....
    see2.loadRequest(request);
}
有人能帮我解决这个问题吗


干杯

info.plist中添加以下行代码:

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>
NSAppTransportSecurity
NSAllowsArbitraryLoads
屏幕截图:


似乎需要身份验证才能加载页面。您可以通过在NSURLRequest的标头中提供凭据信息来修复它


进入您的plist,右键单击信息属性列表单击添加新行,然后将新行添加为应用程序传输安全系统,并在此行内添加允许任意加载为


Hi sakir,我已经将这些代码添加到info.plist,但它仍然显示为空白,idk为什么