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:(NSInteger)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)?