I\'m using NSUserDefaults in my app and I would like to be notified when a particular value is changed. For that, I added the following lines in viewDidLoad:
NSUserDefaults is not KVO compliant, but NSUserDefaultsController is. So you'd use:
NSUserDefaultsController *defaultsc = [NSUserDefaultsController sharedUserDefaultsController]; [defaultsc addObserver:self forKeyPath:@"values.pref_server" options:NSKeyValueObservingOptionNew context:NULL];