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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:47:19+00:00 2026-05-25T11:47:19+00:00

How would I allow the app to save & load the current state of

  • 0

How would I allow the app to save & load the current state of a button (i.e. if it is hidden, how would I save this, so that next time it will be hidden)? Also, I have it currently set so that when a button is pressed, all the other buttons become un-hidden. How can I set it so that certain ones don’t become un-hidden if they have been set un-hidden in NSUserDefaults if you see what I mean?

Thanks

  • 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-25T11:47:20+00:00Added an answer on May 25, 2026 at 11:47 am

    You can check with Apple’s documentation on NSUserDefaults to get any additional information you need.

     NSUserDefaults *defaults = [NSUserDefaults standardDefaults];
     [defaults setObject:myBool boolForKey:@"hiddenButton"];
     [defaults synchronize];
    

    Then you can just pull it in the same way and set your hidden value.

    NSUserDefaults *defaults = [NSUserDefaults standardDefaults];
    myButton.hidden = [defaults boolForKey:@"hiddenButton"];
    

    EDIT:

    This would be one way to implement, but it really depends on what you want.

    myViewController.h
    
    BOOL myButtonState;
    
    
    myViewController.m
    
    -(void)viewDidLoad {
    
       NSUserDefaults *defaults = [NSUserDefaults standardDefaults];
       myButton.hidden = [defaults boolForKey:@"hiddenButton"];
    
    }
    
    -(IBAction)buttonPressed {
    
      myButtonState = TRUE;
      NSUserDefaults *defaults = [NSUserDefaults standardDefaults];
      [defaults setObject:myButtonState boolForKey:@"hiddenButton"]; 
      [defaults synchronize];
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a Silverlight app that would allow a user to upload a
The usual case. I have a simple app that will allow people to upload
I need to find or develop an app that will load in a pdf
I have an app I'm designing that will allow for lots of PDF viewing.
I want to create a Web app which would allow the user to upload
I would like to allow users to call my ruby on rails app as
Would you be aware of any tools(preferably free) or browser plugins that would allow
I would like to add a feature onto my site that would allow a
Is there a command that would allow me to check if the string xyz
Is there any libraries that would allow me to use the same known notation

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.