macOS Mojave中的WkWebView问题 [英] WkWebView problems in macOS Mojave

查看:343
本文介绍了macOS Mojave中的WkWebView问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常简单的应用程序,它仅在WKWebView中显示一个网站,但是升级到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. The App compiles but doesn't start.

我的代码:

@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))
}

我得到的警告:

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

由于macOS Mojave还不算老,所以我在互联网上找不到任何有用的东西.我希望有人能帮助我.

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

可以通过在项目"->功能"中关闭应用程序沙箱"来停止第二次警告

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

这篇关于macOS Mojave中的WkWebView问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆