Simple Swift WebView not working (Xcode 6 Beta 3)
swift, uiwebview, xcode6
Solution
You simply haven't connected your UIWebView to the `webview` class property
Open the assistant editor, show your xib or storyboard at left, your view controller source file at right, click on the circle at the left of the `webview` property and drag into the `UIWebView` control. Once the connection is established, run the app and it should work now
Problem
I was writing a simple WebView in Swift, but everytime I try to launch it in the iOS Simulator I get these errors. What is going wrong? ``` import UIKit class ViewController: UIViewController { @IBOutlet var webview: UIWebView var urlpath = "http://www.google.de" func loadAddressURL(){ let requesturl = NSURL(string: urlpath) let request = NSURLRequest(URL: requesturl) webview.loadRequest(request) } override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. loadAddressURL() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } } ``` Error: ``` fatal error: unexpectedly found nil while unwrapping an Optional value (lldb) self uiwebview.ViewController 0x7987fc70 0x7987fc70 request NSURLRequest * 0x78ebfc40 0x78ebfc40 requesturl NSURL * "" 0x78ec0040 ```