WkWebView problems in macOS Mojave

非 Y 不嫁゛ 提交于 2019-12-18 07:08:14

问题


I have a very simple App that just displays a Website in a WKWebView but after upgrading to macOS Mojave i get some weird warnings messages. The App compiles but doesn't start.

My Code:

@IBOutlet var webView: WKWebView!

override func loadView() {
    webView = WKWebView()
    webView.navigationDelegate = self
    view = webView
}

override func viewDidLoad() {
    super.viewDidLoad()

    let url = URL(string: "https://www.apple.com")!
    webView.load(URLRequest(url: url))
}

The warnings i get:

2018-10-08 19:27:24.466406+0200 MyApp[616:13277] [default] Unable to 
load Info.plist exceptions (eGPUOverrides)
2018-10-08 19:27:24.689229+0200 MyApp[616:13232] [User Defaults] 
Couldn't read values in CFPrefsPlistSource<0x600002910070> (Domain: 
com.apple.Accessibility, User: kCFPreferencesCurrentUser, ByHost: No, 
Container: kCFPreferencesNoContainer, Contents Need Refresh: No): 
accessing preferences outside an application's container requires user- 
preference-read or file-read-data sandbox access

Since macOS Mojave isn't that old I didn't find anything useful on the internet. I hope someone can help me.

EDIT: The second warning can be stopped by turning off "App Sandbox" in Project -> Capabilities


回答1:


This error is caused by enabled Sandbox being enabled. Disabled that in Capabilities -> Sandbox.

accessing preferences outside an application's container requires user- preference-read or file-read-data sandbox access


来源:https://stackoverflow.com/questions/52707411/wkwebview-problems-in-macos-mojave

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!