我一直在努力解决这个问题。我正在尝试使用UIWebview并且我一直遇到致命错误,如下所示"致命错误:在展开可选值(lldb)"时意外地发现了nil。然后在我的代码中它说"线程1:EXC_BAD_INTRUCTION(代码= EXC_1386_INVOP,子代码0x0"。我不明白为什么我继续这样做。另外,我对编码很新。我将在下面发布代码。
class ViewController: UIViewController {
@IBOutlet var WebView: UIWebView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
let URL = NSURL(string: "http://www.google.com")
WebView.loadRequest(NSURLRequest(URL: URL!))
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}