Search code examples
iphoneapplication-settings

NSUserDefaults in App Not Updating View in iPhone Settings App


When I change and synchronize value in my app, they get saved, but the changes do not appear in the settings app. Is there a way to get them synced while maintaining the ability to make changes inside the app? Here is my code:

//I'm registering the defaults from the Settings bundle I created using David Keegan's class inside my application delegate
+ (void)initialize{
    if([self class] == [VirtualVeloAppDelegate class]){
        [InAppSettings registerDefaults];
    }
}

//I'm accessing the values like so
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
[ud boolForKey:@"_someKey"]

//I'm setting the values like so
[[NSUserDefaults standardUserDefaults] setBool:switch.isOn forKey:@"_someKey"];

//After I'm done I sync
[ud synchronize];

The values are getting saved and recalled accurately in my application both on the iPad and iPhone. However they are not updating the Settings app.

I think the fact that I've found no clear cut explanation of this likely indicates Settings.bundle parameters can only be modified in the Settings app.


Solution

  • Although I was using Keegan3d's InAppSettings code in my app and it wasn't working, I used a fresh download of that project without any modifications and it worked. So if implemented correctly, the code from this project works. I'm not sure where I had gone wrong.