Cocoa App webview not loading request

情到浓时终转凉″ 提交于 2019-12-03 07:58:50

问题


I have used webview to load url but it is not loaded.

i have tried the same with wkwebview but couldn't load url.

I have done following

  • import WebKit
  • Info.plist
    • Allow Arbitrary Loads - YES
    • Allow Arbitrary Loads in Web Content - YES

LOG:

dnssd_clientstub ConnectToServer: connect()-> No of tries: 1

dnssd_clientstub ConnectToServer: connect()-> No of tries: 2

dnssd_clientstub ConnectToServer: connect()-> No of tries: 3 dnssd_clientstub ConnectToServer: connect() failed path:/var/run/mDNSResponder Socket:11 Err:-1 Errno:1 Operation not permitted

nw_resolver_create_dns_service_locked DNSServiceCreateConnection failed: ServiceNotRunning(-65563)

-CODE

 @IBOutlet weak var webvw: WebView!

 override func viewDidAppear() {
        super.viewDidAppear()

        guard let url = URL(string: "https://www.google.co.in") else { return }
        let request = URLRequest(url: url)

        webvw.uiDelegate = self
        webvw.frameLoadDelegate = self
        webvw.mainFrame.load(request)
    }

回答1:


Check capabilities > Incoming and outgoing connections




回答2:


Select target

  1. find capabilities
  2. Turn on app sand box if it's off
  3. Tick both network option

done




回答3:


@Rakshit Korat had the answer. For a visual answer:

xCode 11

Under Target / Signing & Capabilities / App Sandbox.



来源:https://stackoverflow.com/questions/46754478/cocoa-app-webview-not-loading-request

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!