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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:34:31+00:00 2026-05-27T07:34:31+00:00

Possible Duplicate: Is there anyway to set values in the settings.bundle from within the

  • 0

Possible Duplicate:
Is there anyway to set values in the settings.bundle from within the APP

I’m developing an iPhone app that will at some point prompt a user alerting them that a setting is switched off. From there they can choose to enable it and continue. I’m able to get the settings and use then in my code, the problem is changing them programmatically. Here’s what I have

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
    if(buttonIndex == 1){

        // Get the application defaults
        NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
        NSDictionary *appDefaults = [NSDictionary dictionaryWithObject:@"YES" forKey:@"enabledAutoCheck"];

        // Set the new settings and save
        [defaults registerDefaults:appDefaults];
        [defaults synchronize]; 
     }
}

I’m making a wild guess (since I only started learning Objective-C and iPhone development 3 days ago!) that it has something to do with the fact that this is setting the default settings meaning they are only used if no previous settings are made.

Is this just missing a little something or is there another way to change settings once they’ve been set initially?

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-27T07:34:31+00:00Added an answer on May 27, 2026 at 7:34 am

    NSUserDefaults is a bit of a misleading name – they are the actual settings, not the defaults.

    You don’t need registerDefaults – instead you could call [defaults setObject:@"YES" forKey:@"enabledAutoCheck"]; (store a setting) then [defaults synchronize]; (save the settings). That way you avoid erasing settings you don’t want to erase.

    The rest of your code is fine. However, do make sure to actually load them where you need them, and make sure that you change the affected UI parts when you change a UI setting. They won’t update themselves, you know 🙂

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

Sidebar

Related Questions

Possible Duplicate: launch facebook app from other app I was wondering if there is
Is it possible to allow duplicate values in the Set collection? Is there any
Possible Duplicate: Is there any way to determine text direction from CultureInfo in asp.net?
Possible Duplicate: Is there a tool that can display a SVN repository visually (
Possible Duplicate: Getting a FILE* from a std::fstream Is there a way to obtain
Possible Duplicate: Get connecting IP from specified ports that using by other program. If
Possible Duplicate: Change the native confirm/alert alert(hello) Is there anyway to change the style
Possible Duplicate: Is there anyway to replace or silence the camera shutter sound in
Possible Duplicate: Splitting a string into chunks of a certain size Is there anyway
Possible Duplicate: Is there memset() that accepts integers larger than char? As it can

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.