views:

38

answers:

1

I have a picker View in one xib file, and a map View in another. The user selects a map view with the picker View, and the clicks a button, which loads the mapView. However, when I return to the picker View xib file, the picker View goes back to the default selection. How do I make the picker view automatically select the mapView that the user selected before?

+1  A: 

Store the selection when you hop away from the XIB, and when you come back in just tell it to reselect.

http://developer.apple.com/iphone/library/documentation/uikit/reference/UIPickerView_Class/Reference/UIPickerView.html#//apple_ref/occ/instm/UIPickerView/selectRow:inComponent:animated:

Joshua Weinberg
for other viewers use [pickerView selectRow:the number row you want shown inComponent:the component number you want shown animated:Yes/NO];
kevin Mendoza