-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Description
If the in app settings controller is visible, if you leave the app and go to the Settings app and change a setting, when you come back to the app the settings controller still has the old values. Fix with these changes:
- (void)viewWillAppear:(BOOL)animated {
...
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationWillEnterForeground:) name:UIApplicationWillEnterForegroundNotification object:nil];
} - (void)viewWillDisappear:(BOOL)animated{
...
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationWillEnterForegroundNotification object:nil];
}
-(void)applicationWillEnterForeground:(NSNotification*)notify{
// reload in settings in case they were changed in the prefs app.
[[NSUserDefaults standardUserDefaults] synchronize];
// show any changes if they happened in the background.
[self.tableView reloadData];
}
Metadata
Metadata
Assignees
Labels
No labels