I created my application settings in Settings.bundle
. I go into the Settings App
and update a value. When I relaunch my app (which was in the background), how do I check for the updated settings in the Settings App
.
I tried the following but I still get the old value. Any suggestions?
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(checkAutoUpdateSettingsForNotificaiton:) name:UIApplicationDidBecomeActiveNotification object:nil];
- (void)checkAutoUpdateSettingsForNotificaiton:(NSNotification *)aNotification
{
NSNumber *period = [[[NSUserDefaults standardUserDefaults] objectForKey:@"periodID"] retain];
}
I had to add [[NSUserDefaults standardUserDefaults] synchronize];
to do the synchronization.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.