views:

101

answers:

1

Hi all,

In the calender app in the iphone, when you click in the starts/end cell, the picker is already fill with data with no delay?

How?

+2  A: 

Your question is not very clear. If you're asking how a UIPickerView can start with a certain value selected, you simply need to use UIPickerView's -selectRow:inComponent:animated: with animated set to NO within -loadView in your UIViewController (or whatever method fires when the view is presented on the screen).

Brad Larson
In the calender app, when you click in the starts/end cell, the picker is already fill with data with no delay, and the first cell in the table above is already selected with no delay.I managed to do this but with a delay.
donodare
If you choose not to animate the selection of the UIPickerView and UITableView rows, then the UI will update without a delay. There must be something else in your code that is running slowly when you transition to the view with the picker on it. I'd suggest running Instruments or Shark and then switching back and forth between the views to see what's requiring the greatest processing time. I've never seen a delay when using selection methods like these.
Brad Larson
I put the select code in the viewDidAppear, any other places doesn't work. And really nothing in the viewDidLoad. still delay.
donodare
Are you sure that nothing else is running when you expose this view? Again, I'd suggest profiling your code with Instruments or Shark to see what's slowing things down. You might be surprised at what you find.
Brad Larson
I just made a new project with nothing at all.I have nothing that use the cpu or something.I used the same way i did, and still delay.To be clear, i mean when "push" the new view, like in the calender.I think apple is doing something special.
donodare
Then I must be doing something special, as well, because I see no delay when pushing in a view containing a UIPickerView that has a preselected item. Once again, I suggest profiling your code to see where the delay is coming from.
Brad Larson