代码之家  ›  专栏  ›  技术社区  ›  pdenlinger

获取视图控制器pickerView:titleForRow:forComponent错误的重新定义

  •  0
  • pdenlinger  · 技术社区  · 16 年前

    我正在努力完成这本书的第一部iPhone开发(O'Reilly)。我在第68页遇到了以下方法和功能的问题;我得到错误“重新定义ViewController pickerView:titleForRow:forComponent error。 已检查空间代码;好像没事。你能查一下密码告诉我怎么了吗?非常感谢。

    -(NSString *)pickerView:(UIPickerView *)pickerView 
            titleForRow:(NSInteger)row forComponent: (NSInteger)component{
    switch (component) {
        case 0:
            return [activities objectAtIndex:row];
        case 1:
            return [feelings objectAtIndex:row];
    }
    return nil;
    

    }

    1 回复  |  直到 16 年前
        1
  •  1
  •   Jacob Relkin    16 年前

    这意味着在类的其他地方定义了这个方法。检查整个类中该方法的其他定义