I open a default cocoa app; one for Mac OS and one for iOS using Storyboards. I drag a Web View (WKWebView) into the default view supplied by Storyboard. I modify the default ViewController.swift file so that for ios it reads
import UIKit
import WebKit
class ViewController: UIViewController, WKNavigationDelegate {
@IBOutlet weak var webView: WKWebView!
override func viewDidLoad() {
super.viewDidLoad()
webView.navigationDelegate = self
let url=URL(string: "https://www.example.com")
webView.load(URLRequest(url: url!))
// Do any additional setup after loading the view.
}
}
And for Mac OS it reads as follows
import Cocoa
import WebKit
class ViewController: NSViewController, WKNavigationDelegate {
@IBOutlet weak var webView: WKWebView!
override func viewDidLoad() {
super.viewDidLoad()
webView.navigationDelegate = self
let url=URL(string: "https://www.example.com")
webView.load(URLRequest(url: url!))
// Do any additional setup after loading the view.
}
override var representedObject: Any? {
didSet {
// Update the view, if already loaded.
}
}
}
I connect the webView variable to the Web View object the same in both projects. The iOS project does what I expect. The Mac OS project fails to display the example page although it appears to run; I just have a blank window. The question is
What am I doing wrong in Mac OS?
Also in Mac OS I get a message "Unable to load Info.plist exceptions (eGPUOverrides)".
I get that message for all my projects in the newer Xcode and have been unable to find any clues as to what it means. Just downloaded an updated Xcode today but I still get that message and still have this problem. Not sure if that relates or not to my question.