专家,我是IOS 9/XCODE 7/Swift 2开发套件的初学者
我正在尝试创建一个只使用HTTPS协议路由到Web应用程序的ios应用程序.下面是我目前的代码ViewController.swift
import UIKit
class ViewController: UIViewController {
@IBOutlet var myWebView: UIWebView!
/**
* Function to Display the Web Application initial URL
*/
func loadAppURL(){
let siteAddress = "https://domain:8443/path/to/page"
let url = NSURL (string: siteAddress)
let urlRequest = NSURLRequest(URL: url!)
myWebView.loadRequest(urlRequest)
}
override func viewDidLoad() {
super.viewDidLoad()
loadAppURL()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
Run Code Online (Sandbox Code Playgroud)
在构建我的应用程序时,它显示以下错误消息
2015-10-01 01:05:13.879网页测试器[2947:31838] NSURLSession/NSURLConnection HTTP加载失败(kCFStreamErrorDomainSSL,-9807)
如果我尝试构建我的应用程序而不是" https://域:8443 /路径/到/页面 "与" http://www.apple.com "它的工作正常. …