label.text = [NSString stringWithFormat:@"%d - %@ - %d",[pickerView selectedRowInComponent:0],
[RowArray objectAtIndex:[pickerView selectedRowInComponent:1]],
[pickerView selectedRowInComponent:2]];
This code is retrieving the row number from the selected row in a component. Arrays are zero indexed and the pickerview (probably) uses array's to manage the rows. So, the first row will be 0, the second 1, the third 2 and so on. This is easily solved by doing:
[pickerView selectedRowInComponent:0] + 1
You can select certain rows programmatically by using selectRow:inComponent:animated
If you want the select the 0th index in each column just do: [pickerView selectRow:0 inComponent:0 animated:YES]
for every component.
klaaspieter
2009-10-11 10:58:28