I have the following code that should change the selected rows in two different components in a UIPickerView, but only the first one changes.
[pickerView selectRow:[pickerView selectedRowInComponent:0] inComponent:1 animated:TRUE];
[pickerView selectRow:[pickerView selectedRowInComponent:1] inComponent:0 animated:TRUE];
But when i do the following, they both change.
[pickerView selectRow:5 inComponent:0 animated:TRUE];
[pickerView selectRow:3 inComponent:1 animated:TRUE];
What is wrong with the first code, why is it not working?
Probably because they refer to each others.
You should record the selected row and then use it: