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 6735525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:01:21+00:00 2026-05-26T11:01:21+00:00

I have a perplexing problem in trying to sort out different behavior of the

  • 0

I have a perplexing problem in trying to sort out different behavior of the same code on an iPhone 4S running iOS 5.0 and an iPad running iOS 4.3.

The view controller code is associated with a view with a date picker to enter a date of birth. Via Interface Builder the date picker is associated with the received action “Value Changed” directed toward the view controller method -(IBAction)birthDate: (id)sender:

-(IBAction)birthDate: (id)sender {

//Code here executed when date of birth entered. Should not be executed when view loads.


}

It is very important in the app that this code NOT be executed when the view loads. I have demonstrated with a breakpoint insertion that this code does not execute when the view loads with iOS 5.0, but does execute when the view loads with iOS 4.3, causing a real problem with the program (the default birthdate becomes interpreted as an entered birthdate). I very much would appreciate advice on how to prevent the IBAction code from executing in iOS 4.3 unless the user changes the default date of birth. I also am very curious as to why this difference in behavior should exist. Thanks in advance.

  • 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-26T11:01:22+00:00Added an answer on May 26, 2026 at 11:01 am

    This is a documented change to UIPickerView’s behaviour in iOS 5.0 (Release Notes)
    One way to get around it on iOS 4.3 would be to have a BOOL that is set to YES at the beginning of loadView and NO at the end.

    Your value changed method birthDate: could then check that this BOOL value is NO before handling the change.

    -(void)loadView
    {
        isViewLoading = YES; // isViewLoading is a BOOL ivar
        // load view
    }
    -(void)viewDidLoad
    {
        // what ever else
        isViewLoading = NO;
    }
    -(IBAction)birthDate:(id)sender
    {
        if (isViewLoading) return;
        // handle change
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a rather confusing problem in running our game. I am trying to
I have a very perplexing problem. A site I'm developing looks fine on iPad,
I have a simple, but perplexing problem, with Math. The following code will take
I have a perplexing SQL select statement (ugly) that I'm trying to write in
I am trying to DRY up some code in HAML, but seem to have
I'm facing a really perplexing problem.. I have a .Net 2.0 C# WinForms project.
I have a problem that is and has been perplexing me for hours. I
I've got a problem thats been perplexing me for a while. I have a
I have been dabbling a little with clisp. It is a little perplexing that
Have you guys had any experiences (positive or negative) by placing your source code/solution

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.