failed to obtain a cell from its dataSource 问题处理
最近在处理bugly问题的时候,总会看到回话列表有奔溃,但是由于没有啥具体的细节原因也无从下手。
只知道ConversationListViewController这个类的奔溃,报的问题是这个,也只有这个信息,所以只能tableview下手
#17009 NSInternalInconsistencyException
UITableView (<UITableView: 0x10e1ad400; frame = (0 88; 414 327); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x280df53e0>; layer = <CALayer: 0x2807a1040>; contentOffset: {0, 156.33333333333334}; contentSize: {414, 394}; adjustedContentInset: {0, 0, 0, 0}>) failed to obtain a cell from its dataSource (<CustomChatUIViewController: 0x10e1b0000>)
YuLin + 10902176
网上查找半天,UITableView常见Crash主要有下面几类:
- dataSource更新后没同步刷新UITableView
- UITableView dataSource is not set
- Invalid update
- failed to obtain a cell from its dataSource
最后发现代码中有一处为了避免数组越界加了这个判断,返回了nil,会导致failed to obtain a cell from its dataSource
if (_conversationList.count<=indexPath.row) {
return nil;
}
//修改后
if (_conversationList.count<=indexPath.row) {//datasource不同步,会出现越界问题,返回nil,有failed to obtain a cell from its dataSource问题
static NSString *ident = @"tempcell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ident];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ident];
}
cell.hidden = YES;
return cell;
}
//看之后的版本效果了,ConversationListViewController的奔溃率下降,那就是这个问题了
failed to obtain a cell from its dataSource 问题处理的更多相关文章
- failed to obtain a cell from its dataSource
stroyboard没有绑定标示 没有注册标示 cell为空时没有创建
- HikariCP 脑火Failed to obtain JDBC Connection: You need to run the CLI build and you need target/classes in your classpath to run.
测试了一下 HikariCP 连接池报错,无解 十一月 16, 2017 5:31:59 下午 org.apache.catalina.core.StandardContext loadOnStart ...
- springCloud微服务调用失败【CannotGetJdbcConnectionException: Failed to obtain JDBC Connection】
详情如下: 2019-07-28 10:56:18.229 ERROR 16212 --- [nio-8081-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet ...
- elastic search报错——“failed to obtain node locks”
启动时报错信息: 这里写图片描述 寻找主要信息:failed to obtain node locks这里写图片描述简单理解为:绑定节点失败!!! 百度后,好多人同样遇到了这个问题,导致的原因可能是因 ...
- Failed to obtain lock on file /usr/local/nagios/var/ndo2db.lock: Permission denied : Permission denied
Failed to obtain lock on file /usr/local/nagios/var/ndo2db.lock: Permission denied : Permission den ...
- elasticsearch failed to obtain node locks
0x00 事件 重启服务器后,启动 elasticsearch 失败,在日志中观察到以下错误: [2019-10-25T17:29:54,639][WARN ][o.e.b.Elasticsearch ...
- nacos Failed to obtain JDBC Connection 连接异常
在conf/目录下,将application.properties.example 改名为bootstrap.properties 将连接数据库信息添加到末尾 # db mysql spring.da ...
- 使用xib创建cell时 bug
UITableView (<UITableView: 0x15799a800; frame = (0 4797; 375 733); clipsToBounds = YES; tag = 305 ...
- 周末发现一个BUG,时有时无,一出程序就崩溃,郁闷了好久,终于跟出来来了,记之,提醒自己今后一定规范编写,只要规范,绝对不会出问题
-- :::] cell0 create -- :::] *** Assertion failure /UITableView.m: -- :::] [ Uncaught Exception ] Na ...
随机推荐
- 对二维数组使用指针进行操作的探索(C语言)
/* Name: 对二维数组使用指针进行操作的探索 Copyright: Author: lingr7 Date: 01/12/18 11:55 Description: */ #include< ...
- Android 获取当前应用的版本号+版本号比较
前言:因为项目更新的时候需要一些版本号的信息,后台返回两个string,一个是最低兼容版,一个是最新版.所以拿到数据后要比较一下,所以封装了一个Common包来处理. Step 1 废话不多说, ...
- play后面加the不加the如何分辨
play表示“参加(某种球类运动或棋牌类的活动)”时,不需要定冠词the,后面直接加球类运动名称或棋牌类活动名称,可根据实际情况翻译成“打,踢,下”等.例如: 1) He often plays fo ...
- 【Linked List Cycle II】cpp
题目: Given a linked list, return the node where the cycle begins. If there is no cycle, return null. ...
- 使用 SceneLoader 类在 XNA 中显示载入屏幕(十)
平方已经开发了一些 Windows Phone 上的一些游戏,算不上什么技术大牛.在这里分享一下经验,仅为了和各位朋友交流经验.平方会逐步将自己编写的类上传到托管项目中,没有什么好名字,就叫 WPXN ...
- CSU-1163 寒衣调
CSU-1163 寒衣调 Description 男从戎,女守家.一夜,狼烟四起,男战死沙场.从此一道黄泉,两地离别.最后,女终于在等待中老去逝去.逝去的最后是换尽一生等到的相逢和团圆. 某日两人至奈 ...
- ROM+VGA 图片显示
内容 1.将一幅图片制成mif文件,初始化rom,图片像素为 120 * 60 2.驱动VGA,将图片显示在屏幕上 1.VGA 时序 下面是我的笔记截图,感觉更好理解. 2.640*480 60hz ...
- Leetcode 592.分数加减运算
分数加减运算 给定一个表示分数加减运算表达式的字符串,你需要返回一个字符串形式的计算结果. 这个结果应该是不可约分的分数,即最简分数. 如果最终结果是一个整数,例如 2,你需要将它转换成分数形式,其分 ...
- nodejs、yarn编译安装
yarn和npm一样,是nodejs的一个依赖管理工具 1.安装nodejs 如果缺少c++ compiler 会报错 yum install -y gcc gcc-c++ 安装nodejs V8 ...
- 历史Linux镜像的问题修复方案
历史Linux镜像创建的ECS云服务器,可能存在NTP没有配置,YUM没有配置,还可能存在最近暴漏较高的安全漏洞,请按照以下步骤进行修复,可以让您的云服务器更加安全,还可以使用阿里云提供的YUM服务进 ...