Reputation:
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
Reputation: 11555
Your variable is called browseweb
, but you call webView.loadRequest(request)
. You need to use the same name...
Upvotes: 1