0

I save the last user selection in the picker view. But when the view is opened again I do not where to use

[pickerView selectRow:lastSelectedRow inComponent:lastSelectedComponent animated:YES];

If I use it in viewDidLoad the problem is UIPickerViewDataSource has not finished yet, so the scrolling is not correct. I can not find delegate function after UIPickerViewDataSource is finished. Where can I use the above line of code?

1 Answer 1

0

You're passing YES in animated argument, thus I assume you want to see it animated -> you should call this method in viewDidAppear, not in viewDidLoad.

1
  • Thank you for your answer. But even in viewDidAppear it does not work, apparently because the view controller main view and subviews including the pickerview did appear, but the data source did not finish yet.
    – user689805
    Apr 5, 2011 at 9:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.