iOS 刷新聊天界面崩溃

Assertion failure in -[UITableViewRowData _assertValidIndexPath:allowEmptySection:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3505.16/UITableViewRowData.m:2310
 
出现NSScanner: nil string argument
 
怎没
共1个回复

lifei9241

2015-09-24 15:42

if ([self.dataSource count] - currentCount  >= 1) {                 [self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:[self.dataSource count] - currentCount - 1 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:NO]; } 加上个判断

造夢

2015-09-24 15:53

- (void)loadMoreMessages { __weak typeof(self) weakSelf = self; dispatch_async(_messageQueue, ^{ long long timestamp = [[NSDate date] timeIntervalSince1970] * 1000 + 1; NSArray *messages = [weakSelf.conversation loadNumbersOfMessages:([weakSelf.messages count] + KPageCount) before:timestamp]; if ([messages count] > 0) { weakSelf.messages = [messages mutableCopy]; NSInteger currentCount = [weakSelf.dataSource count]; weakSelf.dataSource = [[weakSelf formatMessages:messages] mutableCopy]; dispatch_async(dispatch_get_main_queue(), ^{ if (weakSelf.dataSource.count) { [weakSelf.tableView reloadData]; [weakSelf.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:[weakSelf.dataSource count] - currentCount - 1 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:NO]; } }); //从数据库导入时重新下载没有下载成功的附件 for (NSInteger i = 0; i < [weakSelf.dataSource count]; i++) { id obj = weakSelf.dataSource[i]; if ([obj isKindOfClass:[MessageModel class]]) { [weakSelf downloadMessageAttachments:obj]; } } NSMutableArray *unreadMessages = [NSMutableArray array]; for (NSInteger i = 0; i < [messages count]; i++) { EMMessage *message = messages[i]; if ([self shouldAckMessage:message read:NO]) { [unreadMessages addObject:message]; } } if ([unreadMessages count]) { [self sendHasReadResponseForMessages:unreadMessages]; } } }); }

造夢

2015-09-24 15:54

我没有动过这个,就下拉刷新聊天界面就报上面提示

lifei9241

2015-09-24 15:57

@1941:恩,你加个判断试试。

造夢

2015-09-24 16:06

好了,谢谢。
点击此处继续提问与开发者们互动

申请试用

提交后工作人员会尽快与您联系进行功能演示
技术咨询已转移到管理后台,请先登录

即时通讯云使用者请在应用详情页面咨询
客服云使用者请进入管理员模式咨询

×

400电话

商务咨询

技术咨询

免费试用