【问题标题】:WkWebView problems in macOS MojavemacOS Mojave 中的 WkWebView 问题
【发布时间】:2018-10-08 17:34:10
【问题描述】:

我有一个非常简单的应用程序,它只在 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 没有那么旧,我在互联网上没有找到任何有用的东西。我希望有人可以帮助我。

编辑:可以通过关闭 Project -> Capabilities 中的“App Sandbox”来停止第二个警告

【问题讨论】:

    标签: swift xcode macos wkwebview appstore-sandbox


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 2019-02-22
      • 1970-01-01
      • 1970-01-01
      • 2019-03-26
      • 2019-05-20
      • 1970-01-01
      • 2020-12-18
      • 2019-06-22
      • 1970-01-01
      相关资源
      最近更新 更多