标签:
被观察者:A
观察者:B
[A addObserver:B forKeyPath:A‘s成员变量‘skeypath options:flag context:NULL];
B需要实现代理:
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
1.keyPath ?=A‘s成员变量‘skeypath
YES doSomething
NO 忽略
触发点:[A setValue: forKeyPath:];
标签:
原文地址:http://www.cnblogs.com/so-magic/p/4631312.html