Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3490382
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:30:35+00:00 2026-05-18T11:30:35+00:00

I’m trying to setup a UI with a UIPickerView that’s populated based on the

  • 0

I’m trying to setup a UI with a UIPickerView that’s populated based on the selected row in a UITableView. Essentially, it’s the same UI you see in the Start & End screen for adding an event in the Calendar app.

http://raoli.com/files/uipicker.png

I’ve got my data source and delegate’s setup so it the picker gets populated based on the selection and properly updates my model… most of the time.

The one hitch I’m getting is when somebody flicks the picker view and then changes the selection is in the table view, the UIPickerViewDelegate tries to records the changes against the new selection in the table view, not the original selection. It’s obviously in my code why this happens and I have some ideas for reworking my to better behave, but I figured I’d see what Apple was doing in their UI.

When you flick the picker and switch the time before the picker finishes rotating, the rotation is immediately stopped, the picker updates to the value for the new type of time, and the original type of time remains unchanged. I’m not seeing any way to cancel the animation, but I could be wrong. I hope I’m wrong, since it would make my life easier.

The other alternative I could see is different UIPickerViews for each attribute and switching them out. So, obviously, the Apple example would have 2 UIPickerView instance. That just creates other work that needs to be done and I thought I’d see if there was a way to do it with a minimal number of views.

Update Aaron’s idea showed some promise, but it looks like there are a number of edge cases about how messages get delivered to the delegate based on the state of the picker, primarily whether or not the picker is currently animating. Since there seems to be no way to determine if the picker is currently spinning (at least via public APIs), trying to work around the possible configurations seemed problematic. I ended up going with multiple pickers, toggling the visibility of the pickers when the selected attribute changes, and ignoring delegate messages from now-hidden UIPickerView instances.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T11:30:35+00:00Added an answer on May 18, 2026 at 11:30 am

    I think

    - (void)selectRow:(NSInteger)row inComponent:(NSInteger)component animated:(BOOL)animated
    

    would be a good candidate. If animated is NO it should display what you want immediately without moving.

    When you decide the data is set, call the method on the picker view to reflect that setting. I expect it will override any current animation or inertia effect and hopefully you will not receive a didSelectRow: in the delegate. If you do it might be necessary to ignore it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.