代码之家  ›  专栏  ›  技术社区  ›  elcool codeVerine

重新加载组件的问题

  •  1
  • elcool codeVerine  · 技术社区  · 14 年前

    我有一个包含两个组件的UIPickerView。 我有两个核心数据实体,其中一个与第二个有一对多的关系。

    - numberOfComponentsInPicker
    - numberOfRowsInComponent
    - titleForRow:forComponent
    - didSelectRow:inComponent
    

    - (void)pickerView:(UIPickerView *)thePickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{
    
     if (component == 0){
        [thePickerView reloadComponent:1];
     }
    }
    

    ^视图将加载数据。但当它运行时,它挂在这个上面。我知道它应该加载第二个组件,但我不知道它是否缺少其他东西,或者需要实现其他方法。

    我打电话的时候到底发生了什么 reloadComponent

    1 回复  |  直到 14 年前
        1
  •  0
  •   chings228    13 年前

    除了连接代理和数据源

    确保将pickerview连接到IB上的IBOUTLET pickerview