I have a single storyboard with 4 screens (segue to each ViewControllers).
An Open Url sequence WILL NOT WORK on any of the additional 3 screen ViewControllers.
It only works on the main View Controller or on a separate storyboard (manual segue).
The View Controllers were created using Cocoa Touch Class: UIViewController.
Throws this error:
Thread 1: "[<UIViewController 0x10b318630> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key WebButton."
I’ve wiped all possible stray connections.
This code works perfectly fine ONLY on the main and separate storyboards:
@IBAction func GoToWebsite(_ sender: UIButton) {
if let url = URL(string: "https://www.google.com") {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
}
I am missing some bit of information…
Thank you.
2
Answers
SOLVED I deleted the three ScreenControllers and started again. This time, it worked.
Your problem is probably some mismatch in outlets or a Button missing. It’s looking for "WebButton" which does not exist. Maybe the name is different? It’s hard to say exactly whats wrong without seeing the setup.