【问题标题】:Call Method With multiple arguments使用多个参数调用方法
【发布时间】:2013-05-05 03:18:13
【问题描述】:

要调用具有多个参数的方法...我的方法名称是 getDataToDisplay。我有一个编译错误。

+ (void) getDataToDisplay:(NSString *)dbPath :(NSString*)filter {
}


 [LettureProve getDataToDisplay: [self getDBPath] :filter];

【问题讨论】:

  • 不要在方法前面加上get;这是为特殊情况保留的,不是这样。
  • 谢谢。我不知道

标签: objective-c methods arguments


【解决方案1】:

您缺少第二个参数的名称

+ (void) getDataToDisplay:(NSString *)dbPath filter:(NSString*)filter {
}

 [LettureProve getDataToDisplay: [self getDBPath] filter:filter];

【讨论】:

  • 谢谢。愚蠢的问题不应该存在:)
【解决方案2】:

你应该使用这个

+ (void) getDataToDisplayWithPath:(NSString *)dbPath andFilter:(NSString*)filter {
}

【讨论】:

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