期待“;”在Xcode中的“WebView”之前

时间:2010-12-06 23:07:38

标签: xcode webkit browser webview void

我正在尝试按照Apple的Mac Dev网站上提供的基本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的例子一样。

- 谢谢

1 个答案:

答案 0 :(得分:2)

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

您是否包含了包含文件?