【发布时间】: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