user5117853
user5117853

Reputation:

Swift use of unresolved identifier 'webView'

I want to add a webview to my application, but i keep getting this freaking error for webview. Please help!

import UIKit

class Browse: UIViewController {

    @IBOutlet weak var browseweb: UIWebView!
    let browseurl = "http://google.com"
    override func viewDidLoad() {
        super.viewDidLoad()
        let requestURL = NSURL(string:browseurl)
        let request = NSURLRequest(URL: requestURL!)
        webView.loadRequest(request)
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


}

Upvotes: 0

Views: 2242

Answers (1)

MirekE
MirekE

Reputation: 11555

Your variable is called browseweb, but you call webView.loadRequest(request). You need to use the same name...

Upvotes: 1

Related Questions