I have a UIPickerView that has two components. The number of rows in component 1 depends on component 0. I am trying the following:
// [picker reloadAllComponents];
[picker selectRow:5 inComponent:0 animated:NO];
[picker reloadComponent:1]; // [picker reloadAllComponents];
[picker selectRow:3 inComponent:1 animated:NO];
// [picker reloadAllComponents];
What happens is that component 0 is set to index 5 and component 1 is showing the info as if index 0 was selected in component 0!
I tried the exact same thing and it works perfectly. Here’s some relevant code:
This code is only relevant if you select the row manually:
I added a button that executes your code when it’s tapped.
Here’s the last relevant piece of code that I have:
Everything works as expected, so the lines you posted aren’t the ones causing the problem. If you can’t figure it out after having read my code (that is tested and working) I suggest you post some more code.