Skip to content

Commit

Permalink
Merge pull request #222 from willbin/master
Browse files Browse the repository at this point in the history
把 setupDidReceiveTypedMessageCompletion 放到 viewDidAppear 中
  • Loading branch information
xhzengAIB committed May 6, 2015
2 parents 939bfa7 + c171eb4 commit 45c43e7
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,15 @@ - (void)viewDidLoad
}];
}
}];
}

// 这里也要把 setupDidReceiveTypedMessageCompletion 放到 viewDidAppear 中
// 不然, 就会冲突, 导致不能实时接收到对方的消息
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];

WEAKSELF
[[LeanChatManager manager] setupDidReceiveTypedMessageCompletion:^(AVIMConversation *conversation, AVIMTypedMessage *message) {
// 富文本信息
if([conversation.conversationId isEqualToString:self.conversation.conversationId]){
Expand All @@ -129,6 +137,11 @@ - (void)viewDidLoad
}];
}

- (void)viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
[[LeanChatManager manager] setupDidReceiveTypedMessageCompletion:nil];
}

- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
Expand Down

0 comments on commit 45c43e7

Please sign in to comment.