开发者

Expected identifier or "(" before "void"?

开发者 https://www.devze.com 2023-01-29 19:52 出处:网络
I am now trying to build a web browser from the tutorial at macdevcenter.com: http://macdevcenter.com/pub/a/mac/2004/05/28/webkit.html?page=3

I am now trying to build a web browser from the tutorial at macdevcenter.com: http://macdevcenter.com/pub/a/mac/2004/05/28/webkit.html?page=3

And I am on the MyDocument.h file part on page 3 that teaches how to set a default home开发者_高级运维page. It says that I have to add these prototypes for some accessors used later on in the .m file:

(void)setDefaultHomepage:(NSString*); // the error says expected "(" before "void"
-(NSString *)getDefaultHomepage;

Can anyone tell me what this means and what I should do about it?

--Thank you!


You need to add a - in front of (void), you may want to put a variable name after as well

-(void) setDefaultHomepage: (NSString*) newhomepage;


I think you need a - in there:

-(void)setDefaultHomepage:(NSString*);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号