, . , KVO. KVO , . , - / :
- (void) observeValueForKeyPath: (NSString*) keyPath ofObject: (id) sender
change: (NSDictionary*) change context: (void*) context
{
id newValue = [change objectForKey:NSKeyValueChangeNewKey];
NSLog(@"New property value: %@.", newValue);
}
" " . , . KVO NSNotification , :
NSDictionary *info = [NSDictionary dictionaryWithObjectsAndKeys:
foo, @"foo", bar, @"bar", nil];
[[NSNotificationCenter defaultCenter] postNotificationName:@"Foo"
object:self userInfo:info];