0

I want load request and when it loaded, I want get url. Can anyone tell what problem in my code?

    let url = NSURL(string: "https://oauth.vk.com/authorize?client_id=4876947&scope=audio&redirect_uri=https://oauth.vk.com/blank.html&display=mobile&v=5.30&response_type=token")
    let request = NSURLRequest(URL : url!)
    webView.loadRequest(request)
    if let currURL: NSString = webView.request?.URL?.absoluteString! {
        getData(currURL)
    }

My error:

erminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key web.' *** First throw call stack

cmashinho
  • 605
  • 5
  • 21

1 Answers1

0

This error can be caused by different things: (reported from this answer)

  • You've changed an Outlet property's name without updating the connection (can be solved via "Connections inspector)
  • You did not set the right ViewController
  • In general a wrong link between storyboard/xib and the code
Community
  • 1
  • 1
user2340612
  • 10,053
  • 4
  • 41
  • 66