我正在尝试在Cocoa / MacOS上实现WKWebView,但出现此错误:
Unable to load Info.plist exceptions (eGPUOverrides)
Couldn't read values in CFPrefsPlistSource<0x600002909f10>
(Domain: com.apple.Accessibility, User: kCFPreferencesCurrentUser,
ByHost: No, Container: kCFPreferencesNoContainer, Contents Need Refresh: Yes): accessing preferences outside an application's container requires user-preference-read or file-read-data sandbox access
这是我的实现方式:
import Cocoa
import WebKit
class ViewController: NSViewController {
@IBOutlet var webView: WKWebView!
override func viewDidLoad() {
super.viewDidLoad()
if let url = URL(string: "https://www.apple.com") {
let request = URLRequest(url: url)
webView.load(request)
}
}
}
我对大家的问题是,如何在实施中解决此问题?还是您知道解决此问题的方法?
非常感谢您的帮助。