我刚接触Objective C,正在学习一份在网上找到的教程。教程开始讲述消息传递和参数分离,并给出了一个示例:
When there's more than one argument, they're declared within the method name after the colons. Arguments break the name apart in the declaration, just as in a message.
- (void)setWidth:(float)width: height:(float)height;
我认为在width后面不应该有冒号,但我可能错了。根据我的研究,我相信这是一个笔误,但由于我是新手,所以我想确认一下。
方法是否只有setWidth: height:
?还是在(float)width
之后还有另一个参数,除了 height:(float)height
?