Hello everyone ^.^,
I have an iPhone app that use UIPickerView and 3 buttons.
This picker has one component with 100 rows (0, 1, 2, ..., 98, 99).
I'd like to implement the code so that, when I press on the buttons
- button1: will make the picker select row 21th (which has value 20)
- button2: will make the picker select row 41th (which has value 40)
- button3: will make the picker select row 60th (which has value 60)
I know how to make the picker select a row when the view first load by put the following code in to viewDidLoad() method:
(void)viewDidLoad
{
........
[picker selectRow:50 inComponent:0 animated:YES];
}
but I could not make the picker select the desired row when I tap the buttons.
Any help would be appreciated!
Thanks for reading ^.^