Commit f98eb318 authored by 乔金柱's avatar 乔金柱

修改removeKVO

parent 709c8acf
......@@ -162,7 +162,10 @@
}
- (void)removeKVO{
// 因为fetchDataSuccess是在viewDidLoad中监听的,所以需要一个判断
if ([self isViewLoaded]) {
[self.viewModel removeObserver:self forKeyPath:@"fetchDataSuccess"];
}
}
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context{
......@@ -191,10 +194,7 @@
- (void)dealloc{
[self removeKVO];
// 因为fetchDataSuccess是在viewDidLoad中监听的,所以需要一个判断
if ([self isViewLoaded]) {
[self.viewModel removeObserver:self forKeyPath:@"fetchDataSuccess"];
}
}
- (void)showEmptyView:(GMEmptyViewType)type {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment