你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
输入关键字进行搜索
搜索:
没有找到相关结果
Half12345
赞同来自: fat1
TAT
江南孤鹜 - 技术改变世界,创新驱动中国.QQ:364223587
- (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; if (self.conversation.conversationType == eConversationTypeGroupChat) { if ([[self.conversation.ext objectForKey:@"groupSubject"] length]) { [self resetConversation];// 更改群昵称后,需要用此方法才能获取最新的群昵称 self.title = [self.conversation.ext objectForKey:@"groupSubject"]; } } } // 获取群组的最新详情 -(void)resetConversation{ NSArray *groupArray = [[EaseMob sharedInstance].chatManager groupList]; for (EMGroup *group in groupArray) { if ([group.groupId isEqualToString:self.conversation.chatter]) { NSMutableDictionary *ext = [NSMutableDictionary dictionaryWithDictionary:self.conversation.ext]; [ext setObject:group.groupSubject forKey:@"groupSubject"]; [ext setObject:[NSNumber numberWithBool:group.isPublic] forKey:@"isPublic"]; NSString *groupSubject = [ext objectForKey:@"groupSubject"]; NSString *conversationSubject = [self.conversation.ext objectForKey:@"groupSubject"]; if (groupSubject && conversationSubject && ![groupSubject isEqualToString:conversationSubject]) { self.conversation.ext = ext; } break; } } }
要回复问题请先登录或注册
5 个回复
Half12345
赞同来自: fat1
TAT
@brief 当前登陆用户的会话对象列表
*/
@property (nonatomic, readonly) NSArray *conversations;
这个方法获取到的会话列表没有变化,用接口获取群组信息是已经改了的,我郁闷
TAT
conversation.ext 是这个扩展属性没更改的原因,这个可以改吗
Half12345
江南孤鹜 - 技术改变世界,创新驱动中国.QQ:364223587
请参考:http://community.easemob.com/question/5863
补充,除了ConversationListController里遇到群组名称没有及时更新的问题之外,ChatViewController也会出现这个问题,解决方法就是仿照ConversationListController从[[EaseMob sharedInstance].chatManager groupList] 获取最新的群详情。
ChatViewController.m中增加函数:
[self resetConversation];即可