预期为“;”在“WebView”之前在Xcode中

发布于 2024-10-06 19:30:39 字数 1050 浏览 3 评论 0原文

我正在尝试遵循 Apple Mac 开发网站上提供的基本 WebKit 教程: http://developer.apple.com/library/ mac/#documentation/Cocoa/Conceptual/DisplayWebContent/DisplayWebContent.html

我正处于将标题更新为当前页面标题并将 URL 更新为当前 URL 的部分。然而,当我尝试构建这个时:

- (void)webView:(WebView *)sender didStartProvisionalLoadForFrame:(WebFrame *)frame //2 errors on this line stating: expected ")" before "WebView" and expected ")" before "WebFrame"
{
//Only report feedback from main frame.
if (frame == [sender mainFrame]) {
    NSString *url = [[[[frame provisionalDataSource] request] URL] absoluteString];
    [textField setStringValue:url];
}
}

- (void)webView:(WebView *)sender didRecieveTitle:(NSString *)title forFrame:(WebFrame *)frame // Same 2 errors as the first line of code
{
if (frame == [sender mainFrame]){
    [[sender window] setTitle:title];
}
}

有人可以告诉我这有什么问题吗?这是 Apple 示例中的准确代码。

- 谢谢

I am trying to follow the basic WebKit tutorial provided on Apple's Mac Dev site:
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/DisplayWebContent/DisplayWebContent.html

I am at the part where I update my title to the current page's title and update the URL to the current URL. However, when I try to Build this:

- (void)webView:(WebView *)sender didStartProvisionalLoadForFrame:(WebFrame *)frame //2 errors on this line stating: expected ")" before "WebView" and expected ")" before "WebFrame"
{
//Only report feedback from main frame.
if (frame == [sender mainFrame]) {
    NSString *url = [[[[frame provisionalDataSource] request] URL] absoluteString];
    [textField setStringValue:url];
}
}

- (void)webView:(WebView *)sender didRecieveTitle:(NSString *)title forFrame:(WebFrame *)frame // Same 2 errors as the first line of code
{
if (frame == [sender mainFrame]){
    [[sender window] setTitle:title];
}
}

Could somebody please tell me what is wrong with this? It is the exact code as Apple's example.

--Thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

荒路情人 2024-10-13 19:30:39

您是否右键单击“框架”并单击“添加现有框架”并添加 Webkit.framework?

你有包含包含文件吗?

Did your right click on "frameworks" and click "Add existing Framework" and add Webkit.framework?

Did you include the include files?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文