Xcode可可:无法读取CFPrefsPlistSource <0x600002909f10>中的值

时间:2019-01-03 19:09:43

标签: macos cocoa xcode10 swift4.2

我正在尝试在Cocoa / MacOS上实现WKWebView,但出现此错误:

Unable to load Info.plist exceptions (eGPUOverrides)
Couldn't read values in CFPrefsPlistSource<0x600002909f10> 
(Domain: com.apple.Accessibility, User: kCFPreferencesCurrentUser,
 ByHost: No, Container: kCFPreferencesNoContainer, Contents Need Refresh: Yes): accessing preferences outside an application's container requires user-preference-read or file-read-data sandbox access

这是我的实现方式:

import Cocoa
import WebKit

class ViewController: NSViewController {
    @IBOutlet var webView: WKWebView!

    override func viewDidLoad() {
        super.viewDidLoad()
        if let url = URL(string: "https://www.apple.com") {
            let request = URLRequest(url: url)
            webView.load(request)
        }
    }
}

我对大家的问题是,如何在实施中解决此问题?还是您知道解决此问题的方法?

非常感谢您的帮助。

0 个答案:

没有答案