Hi guys I have this app that when my nsuserfaults change I want to detect that change and execute some code so I came across Key-Value-Observing. It works fine and all but I need to way to observe more than one key. This is the code I am using:
And this method is called whenever the user defaults is changed. Is there a way to observe multiple keys. Thanks a lot in advance.
Code:
[[NSUserDefaults standardUserDefaults] addObserver:self
forKeyPath:@"On/Off"
options:NSKeyValueObservingOptionNew
context:NULL];
And this method is called whenever the user defaults is changed. Is there a way to observe multiple keys. Thanks a lot in advance.
Code:
-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context{
}