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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:52:50+00:00 2026-06-18T09:52:50+00:00

I am having some trouble while working with UISwitch on a static UITableView .

  • 0

I am having some trouble while working with UISwitch on a static UITableView.
I have to restore the last state of a certain UISwitch when the App loads, but whenever I check the state of the IBOutlet, it is nil. I have tried to manually alloc the variable, which was of no help either.

Here is what I am doing:

SettingsController.h

//IBOutlet connected correctly
@property (strong, nonatomic) IBOutlet UISwitch *switch_displayDetail;

SettingsController.m

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];

    if (!_switch_displayDetail) {
        NSLog(@"_switch_displayDetail is NIL"); //This is always displayed
    }

    //Switch is default to YES, I am trying to set it to NO
    //This line does nothing...
    [_switch_displayDetail setOn:[dataManager shouldDisplayDetail] animated:YES];
}

Everywhere else when I check the state of _switch_displayDetail it is nil. I am calling all the super initialization methods.
Did anything change on iOS 6.1?

[EDIT] Using the synthesized variable does not work either.

[EDIT 2] Found the problem to be a bug on Xcode or on iPhone Simulator. After testing on my iPod touch, the initial algorithm worked perfectly.

I am going nuts with this problem…

  • 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-06-18T09:52:51+00:00Added an answer on June 18, 2026 at 9:52 am

    Thanks everyone for your answers, but after almost giving up, I tested my App on my iPod touch and it worked perfectly. This looks like a bug on the iPhone Simulator or, much probably a bug on Xcode (nothing new here). After reseting all settings and data on the iPhone Simulator menu, it worked there too.

    So, before going crazy, test your App on a real device.

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

Sidebar

Related Questions

I have been having some real trouble with this for a while. I am
I'm working on an iOS app and have had some trouble with getting photos
I'm having trouble with some Regex code while scraping YouTube playlist pages. It mostly
Having some trouble with R's garbage collection, when passing objects to C++. We have
I'm trying to build some iOS apps while learning and am having some trouble
I am working on a REST based API, and having some trouble figuring out
I am working on mocking some external dependencies and am having trouble with one
I'm working on building my own string class and I'm having some trouble with
I'm currently working on a small jQuery element but having some trouble with clearInterval.
I am having some trouble with my PHP code. Basically I have a list

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.