tags:

views:

8

answers:

1

Does anyone know a way that I can set my picker to default / startup with row values that are not right at the start of my datasource? If possible I would like the picker to start with a middle value so I don't get the blank white area at the top.

alt text

EDIT_001

Added the following lines to viewDidLoad, which seems to be the best place to call these as the UI is being built.

[doublePicker selectRow:2 inComponent:kCoffeeIndex animated:NO];
[doublePicker selectRow:2 inComponent:kCakeIndex animated:NO];

gary

+1  A: 

Use -selectRow:inComponent:animated: for that.

Costique
I see, so where would that go as I only want it to fire when the UI is first displayed. Does it go in one of the datasource methods?
fuzzygoat
You're right, -viewDidLoad is the best place to do that.
Costique