I went over the article about the bundle setting at here. They have 2 class m. One is AppDelegate.m and the other is MyViewController.m ( this is a UITableViewController).
If a user makes a change to Settings, the change will be notified by
then an update to UI will be handle by
In this example, they are updating the UI by using
What if we do have another class which is not UITablewViewController, how can we make a call to update what have been changed in Settings.
Please advice me on this issue, all hints are welcomed.
If a user makes a change to Settings, the change will be notified by
Code:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(defaultsChanged:)
name:NSUserDefaultsDidChangeNotification
object:nil];
Code:
- (void)defaultsChanged:(NSNotification *)notif
{
NSLog(@"CHANGE CHANGE CHANGE");
[self setupByPreferences];
UITableView *tableView = ((UITableViewController *)self.navigationController.visibleViewController).tableView;
[tableView reloadData];
}
In this example, they are updating the UI by using
Code:
UITableView *tableView = ((UITableViewController *)self.navigationController.visibleViewController).tableView;
[tableView reloadData];
What if we do have another class which is not UITablewViewController, how can we make a call to update what have been changed in Settings.
Please advice me on this issue, all hints are welcomed.