KVC:
KVO: - (void)addObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath options:(NSKeyValueObservingOptions)options context:(void *)context;
相当于观察者机制,当你观察的对象的值发生变化时会调用
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context;在这里你可以对你的响应的对象做出响应的变化
需要在你的delloc中- (void)removeObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath;
KVO: - (void)addObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath options:(NSKeyValueObservingOptions)options context:(void *)context;
相当于观察者机制,当你观察的对象的值发生变化时会调用
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context;在这里你可以对你的响应的对象做出响应的变化
需要在你的delloc中- (void)removeObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath;