gpt4 book ai didi

macos - setMainFrameURL 是否真的定义在 webView 中

转载 作者:行者123 更新时间:2023-11-30 14:13:33 25 4
gpt4 key购买 nike

我是 cocoa 编程的新手。我打算尝试 webkit View 类。根据此页面:

https://developer.apple.com/library/mac/documentation/Cocoa/Reference/WebKit/Classes/WebView_Class/index.html

Web View 应该有一个名为“setMainFrameURL”的方法。但是,当我尝试使用它时,我收到一条错误消息,指出该方法未定义。这怎么可能?这种方法真的存在吗?

最佳答案

setMainFrameURL是一种 Objective C 方法。等效的 Swift 语法是

webView.mainFrameURL = "http://www.google.com"

关于macos - setMainFrameURL 是否真的定义在 webView 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31490147/

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