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

  • Home
  • SEARCH
  • 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 6200329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:20:47+00:00 2026-05-24T04:20:47+00:00

I have a small problem with an UIPickerView. It is part of a class

  • 0

I have a small problem with an UIPickerView. It is part of a class that is displayed as a SemiModalViewController, which can be dismissed (and freed) at any time by pressing an OK button. This class also implements the UIPickerView delegate functions to accept any selection changes etc.

The problem is that the UIPickerView might still be scrolling to an entry while the OK button is pressed – this of course leads to a crash, because the end of the scrolling will try to call the selection changed delegate in the now already freed parent class for the UIPickerView.

Is there any way to check whether the picker view is in a scrolling state and wait for it to end before I dismiss the parent class? I’d rather leave the delegate functions with the mentioned parent class, as this forms a ‘dismissable general Picker’ UI component, and I’d rather not like to keep all these classes around until the application ends just to make sure the scrolling of the picker eventually ends …

  • 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-24T04:20:47+00:00Added an answer on May 24, 2026 at 4:20 am

    Ok, I developed a solution …

    In fact, all I want to do is make sure the Picker does not try to send a Selection Changed event to a non-existing parent class. In case of the picker still scrolling, that can also mean just discarding any end value it might have reached.

    Unfortunately the UIDatePicker and the UIPickerView also are quite different in behavior, so the solution was a bit more work than I thought.

    For those who are interested:

    I made a singleton class that keeps track of all Pickers I create. This singleton class also serves as delegate for all Picker callbacks – so all pickers will always succeed in calling them. Of course, in case the parent class does not exist anymore, the result will be discarded.

    Once I get rid of a Picker, the singleton marks it for deletion after x seconds, and removes it around that time from the list of Pickers to follow. In fact, I could remove the Picker right away, as the singleton will still take any callback from that picker anyway and just ignore the result.

    Some effort, but it works like a charm now. No more crashes, and defined behavior in all cases :-).

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

Sidebar

Related Questions

I have a small problem here and hope that someone can help me out.
I have a small problem and I do not find any solutions. I want
i have small problem understanding why my smart pointer class is leaking on self
I have small problem. I learn java SE and find class ClassLoader. I try
I have a small problem with android maps. I added an ItemizedOverlay class to
I have a small problem that I want to load a url in web
I have a small problem that I don't know how to deal with. I've
I have one small problem regarding MPMoviePlayerController, i have a link that play movie
I have a small problem with rollover effects. First time after loading everything's fine.
I have a small problem, I would like a div to be displayed when

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.