【问题标题】:Error when Declaring arguments for a method in objective C在目标 C 中为方法声明参数时出错
【发布时间】:2014-01-03 04:13:52
【问题描述】:

我不确定我在这里做错了什么,我正在关注一个在线教程(thenewboston),我收到一个错误,上面写着“w 用作前一个参数的名称而不是选择器的一部分。 "

-(void)setWH: (int) w:(int) height;

【问题讨论】:

标签: c methods arguments


【解决方案1】:

您缺少选择器名称的一部分:

- (void)setWidth:(int)width height:(int)height;
//                          ^--- You're missing this.

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-26
    • 1970-01-01
    相关资源
    最近更新 更多