Is there a way to make the PickerView in Xcode start at a default row? Right now, my PickerView starts at the first element in my array.
So for example, if I have 1 component with 30 rows, how can I make the PickerView start at row 15 when the user first sees the PickerView?
Thanks
use -[UIPickerView selectRow:inComponent:animated:] ... assuming you have one component, do the following:
UIPickerView *aPicker = [[[UIPickerView alloc] init] autorelease];
aPicker.delegate = self;
aPicker.dataSource = self;
aPicker.showsSelectionIndicator = YES;
[self.view addSubview:aPicker];
[aPicker selectRow:14 inComponent:0 animated:NO];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With