gpt4 book ai didi

swift - macOS Mojave 中的 WkWebView 问题

转载 作者:可可西里 更新时间:2023-11-01 01:56:41 25 4
gpt4 key购买 nike

我有一个非常简单的应用程序,它只在 WKWebView 中显示一个网站,但是在升级到 macOS Mojave 之后,我收到了一些奇怪的警告消息。应用程序编译但不启动。

我的代码:

@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 不是那么旧,我没有在互联网上找到任何有用的东西。我希望有人能帮助我。

编辑:可以通过在项目 -> 功能中关闭“App Sandbox”来停止第二个警告

最佳答案

此错误是由于启用了已启用的沙箱引起的。在 Capabilities -> Sandbox 中禁用它。

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

关于swift - macOS Mojave 中的 WkWebView 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52707411/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com