My NSMutableDictionary contains simple keys (@"one", @"two", @"three") and complex keys (@"com.alpha", @"com.beta"). Is it possible to use observers for a complex key?
Observers work well with simple keys, but didn't worked with complex keys. What is a solution?
[self.dict addObserver:self forKeyPath:@"com.alpha" options:NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew context:nil];
-(IBAction) onChange:(id)sender
{
[self.dict setObject:@"newValue" forKey:@"com.alpha"];
}
-(void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
{
NSLog(@"____ value had changed");
}