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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:02:59+00:00 2026-05-23T02:02:59+00:00

I have a UISplitViewController utility type app where each UIViewController handles various calculations. I

  • 0

I have a UISplitViewController utility type app where each UIViewController handles various calculations. I have a popover with segmented controls that allows the user to set certain options. The problem I have is when saving and reloading the contents of UITextfields and the selected segment index, if the segment control index was saved and is == 1 a valuechanged event is fired off from viewdidload as the state is set from

   NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
   theDepthSegment.selectedSegmentIndex = [[defaults objectForKey:@"updateMe"] intValue];

Is there anyway to prevent valuechanged being fired as the selectedsegment is set in view did load? or maybe someway to determine the difference between touch events versus code

It seems strange this happens, maybe there is another way….

Thank You

  • 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-23T02:03:00+00:00Added an answer on May 23, 2026 at 2:03 am

    Considering the view is just loading, the segmented control doesn’t have a previous value, so it will assume it is indeed being changed and acts accordingly. One way you could potentially get around this is to set up a BOOL value in your IBAction method linked to the segmented control. At the beginning of your viewDidLoad method, say wasLoaded = NO (where wasLoaded will need to be declared in your header file). Then you’ll assign your selectedSegmentIndex. Afterwards, declare wasLoaded = YES. Finally, in your IBAction method, say something like

    if (wasLoaded) { 
        // do what you need to do since this isn't when it's being initialized 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For the app that i am developing i have used a UISplitViewController as my
When using a UISplitViewController in portrait , I have a settings popover that I
I have UISplitViewController that I want to be updated from a UIViewController that is
I have this button on the leftside of my UISplitViewController (RootViewController) that has a
I am building a universal app that uses a UISplitViewController for the iPad, and
I have the following setup: A subclass of UISplitViewController that creates the master and
I have created a UISplitViewController based iOS app in XCode 3.2.5 Below is a
I have an app that is going to navigate to a UISplitView (inside another
I have a UISplitViewController in a xib file that contains two custom UIViewControllers. I
I have a universal app, and on the iPad version I'm using UISplitViewController to

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.