简体   繁体   English

macOS Mojave中的WkWebView问题

[英]WkWebView problems in macOS Mojave

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. 我有一个非常简单的应用程序, WKWebViewWKWebView显示一个网站,但是升级到macOS Mojave后,我收到一些奇怪的警告消息。 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. 由于macOS Mojave还不算老,所以我在互联网上找不到任何有用的东西。 I hope someone can help me. 我希望有一个人可以帮助我。

EDIT: The second warning can be stopped by turning off "App Sandbox" in Project -> Capabilities 编辑:第二个警告可以通过在项目->功能中关闭“应用程序沙箱”来停止

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM