预期为“;”在“WebView”之前在Xcode中
我正在尝试遵循 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否右键单击“框架”并单击“添加现有框架”并添加 Webkit.framework?
你有包含包含文件吗?
Did your right click on "frameworks" and click "Add existing Framework" and add Webkit.framework?
Did you include the include files?