fix no chats list

This commit is contained in:
Danmei Chen 2018-12-20 15:05:58 +01:00
parent 5b1ef49919
commit 445b620be5

View file

@ -35,6 +35,10 @@
selector:@selector(callUpdateEvent:)
name:kLinphoneCallUpdate
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(onGlobalStateChanged:)
name:kLinphoneGlobalStateUpdate
object:nil];
[_backToCallButton update];
self.tableController.waitView = _waitView;
[self setEditing:NO];
@ -43,7 +47,7 @@
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
[NSNotificationCenter.defaultCenter removeObserver:self name:kLinphoneMessageReceived object:nil];
[NSNotificationCenter.defaultCenter removeObserver:self];
self.view = NULL;
}
@ -57,6 +61,16 @@
[_backToCallButton update];
}
- (void)onGlobalStateChanged:(NSNotification *)notif {
LinphoneGlobalState state = (LinphoneGlobalState)[[[notif userInfo] valueForKey:@"state"] integerValue];
if (state == LinphoneGlobalStartup) {
_waitView.hidden = NO;
} else if (state == LinphoneGlobalOn) {
[_tableController loadData];
_waitView.hidden = YES;
}
}
#pragma mark - UICompositeViewDelegate Functions
static UICompositeViewDescription *compositeDescription = nil;