开发者

Problem with reloadComponent

I have a UIPickerView with 2 components. And I have 2 Core Data entities, where one has a relationship one-to-many to the second one.

I've implemented this 4 delegate functions:

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

where the last one is as:

- (void)pickerView:(UIPickerView *)thePickerView didSelectRow:(NSIntege开发者_高级运维r)row inComponent:(NSInteger)component{

 if (component == 0){
    [thePickerView reloadComponent:1];
 }
}

^ The view loads with data. But when it runs it hangs on this one. I understand it's supposed to load the second component, but I don't know if it's missing something else, or another method needs to be implemented.

What is really going on when I call reloadComponent ? And how can I load the second column (component) with other data after user has selected the first column (component)?


apart from connect delegate and data souce

make sure u connect the thePickerView to the IBOUTLET pickerview at the IB

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜