Send Notification When a Property is Changed Using KVO
问题 I had a property named myName in my class, like: @property (nonatomic, strong) NSString *myName; I need to send a notification when the myName property's value is changed. Now I'm doing something like: - (void)setMyName:(NSString *)name { _myName = name; [[NSNotificationCenter defaultCenter] postNotificationName:CHANGE_NOTIFICATION object:nil]; } I know there is something like Key-Value Observing in iOS. But I don't know how to implement it, I read the entire document, but couldn't get a good