*** Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:], /BuildRoot/Library/C
来源:互联网 发布:vb.net 开发工具 编辑:程序博客网 时间:2024/06/18 09:31
使用UITableView出现
2.没有判断cell 为空值,应该像上面的代码一样,有If语句来判断cell是否为空。错误的写法如下:
下面是初始化celll的正确方法:
*** Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3512.60.7/UITableView.m:7971的解决方法。
1.可能是把return Cell;放在了if语句内如下所示:
{ static NSString *CellIdentifier1 = @"hotCell"; HotCity_Cell *hotCell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier1]; if (hotCell == nil) { hotCell = [[HotCity_Cell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier1]; hotCell.backgroundColor = [UIColor clearColor]; return hotCell;// 把return 语句写在这里 }// return hotCell;// return 语句应该写在这里}
2.没有判断cell 为空值,应该像上面的代码一样,有If语句来判断cell是否为空。错误的写法如下:
{ static NSString *CellIdentifier1 = @"hotCell"; HotCity_Cell *hotCell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier1]; hotCell = [[HotCity_Cell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier1]; hotCell.backgroundColor = [UIColor clearColor]; return hotCell;}
下面是初始化celll的正确方法:
{ static NSString *CellIdentifier1 = @"hotCell"; HotCity_Cell *hotCell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier1]; if (!hotCell) { hotCell = [[HotCity_Cell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier1]; hotCell.backgroundColor = [UIColor clearColor]; } return hotCell;}
1 0
- *** Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:], /BuildRoot/Library/C
- Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:], /BuildRoot/Library/Cache
- 报错:*** Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:], /BuildRoot/Librar
- Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
- Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
- Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
- Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
- Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
- Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
- Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
- Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
- Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
- Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
- storyboard Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
- Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]解决办法
- iOS:编译问题 Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
- Tableview出现Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
- Assertion failure in -[UITableView _dequeueReusableViewOfType:withIdentifier:], /BuildRoot/Library/C
- Centos 7 安装过程中的一些坑
- windows下Google Protocol Buffer 编译安装教程
- 随机生成15个数,最小的在最下方。。。。。。。
- Android使用procrank和dumpsysmeminfo分析内存占用情况
- 完全二叉树
- *** Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:], /BuildRoot/Library/C
- Mysql 存储引擎中InnoDB与Myisam的主要区别
- 小波工具箱的使用2
- MATLAB全局变量
- 我的第一次作业喔
- 这叫啥事
- Plist—ios应用数据存储方式
- 版本回退和远程仓库
- CentOS下安装hadoop