我仍在使用Apple的网站上的WebKit教程遇到问题:http: //developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/DisplayWebContent/Tasks/MultipleWindows.html
.h文件如下:
#import <Cocoa/Cocoa.h>
#import <WebKit/WebKit.h>
@interface MyDocument : NSDocument
{
IBOutlet id webView;
IBOutlet id textField;
}
- (IBAction)connectURL:(id)sender //Provides me with the error 'Expected ";" before "{" token'
{
[[webView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[sender stringValue]]]];
}
@end
Run Code Online (Sandbox Code Playgroud)
你能看到任何有问题的东西吗?为什么它会给我一个问题呢?
- 谢谢!
我现在正在尝试从macdevcenter.com上的教程构建一个Web浏览器:http://macdevcenter.com/pub/a/mac/2004/05/28/webkit.html?page = 3
我在第3页的MyDocument.h文件中教授如何设置默认主页.它说我必须为以后在.m文件中使用的一些访问器添加这些原型:
(void)setDefaultHomepage:(NSString*); // the error says expected "(" before "void"
-(NSString *)getDefaultHomepage;
Run Code Online (Sandbox Code Playgroud)
谁能告诉我这意味着什么以及我应该怎么做呢?
- 谢谢!