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 ...
随机推荐
- Admin站点
使用admin站点 a.在settings.py中设置语言和时区 LANGUAGE_CODE = 'zh-hans' # 使用中国语言 TIME_ZONE = 'Asia/Shanghai' # 使用 ...
- 使用HTTP协议访问网络
在Android上发送http请求有2种方式,分别由两个类完成,HttpURLConnection和HttpClient. 一.使用HttpURLConnection方式 1.1 建立连接的基本步骤 ...
- PAT Basic 1085
1085 PAT单位排行 每次 PAT 考试结束后,考试中心都会发布一个考生单位排行榜.本题就请你实现这个功能. 输入格式: 输入第一行给出一个正整数 N(≤105),即考生人数.随后 N 行, ...
- React基础(Diff算法,属性和状态)
1.React的背景原理 (1)React Diff算法流程 (2)React虚拟DOM机制 React引入了虚拟DOM(Virtual DOM)的机制:在浏览器端用Javascript实现了一套DO ...
- idea 安装findBugs 可以做代码扫描,也可以导出扫描结果生成扫描报告
idea 安装findBugs 可以做代码扫描,也可以导出扫描结果生成扫描报告 https://my.oschina.net/viakiba/blog/1838296 https://www.cnbl ...
- WEBs
http://www.cnblogs.com/wupeiqi/articles/5341480.html 请求方式8种: 1.GET:请求指定页面信息,并返回实体 2.POST:向指定资源提交数据进行 ...
- Django之session验证的三种姿势
一.什么是session session是保存在服务端的键值对,Django默认支持Session,并且默认是将Session数据存储在数据库中,即:django_session 表中. 二.FVB中 ...
- 【Luogu P1120】小木棍
题目: 乔治有一些同样长的小木棍,他把这些木棍随意砍成几段,直到每段的长都不超过$50$.现在,他想把小木棍拼接成原来的样子,但是却忘记了自己开始时有多少根木棍和它们的长度.给出每段小木棍的长度,编程 ...
- Python-S9-Day89_stark总结
01 Stark总结 02 ORM总结 03 上节作业 04 Stark组件之查看页面表头 05 list_display_links 06 stark组件之添加页面 07 编辑删除页面 01 Sta ...
- python批量爬取文档
最近项目需要将批量链接中的pdf文档爬下来处理,根据以下步骤完成了任务: 将批量下载链接copy到text中,每行1个链接: 再读txt文档构造url_list列表,利用readlines返回以行为单 ...