UItableView Crash--Assertion failure
来源:互联网 发布:淘宝门头图片素材 编辑:程序博客网 时间:2024/05/17 12:04
Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
今天做一个tableView遇到一个这么个问题。
经过baidu google,终于找到正解。
因为
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
这个函数的返回值是个null!!
查stackoverflow 找到下面的解。
CellIdentifier I bet your cellForRowAtIndexPath is returning null.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ static NSString *CellIdentifier = @"Photos"; /** NOTE: This method can return nil so you need to account for that in code */ UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; // NOTE: Add some code like this to create a new cell if there are none to reuse if(cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } NSString *string = [[self.photosInPlace objectAtIndex:indexPath.row] valueForKeyPath:@"description._content"]; cell.textLabel.text = string; return cell;}
That's probably why [UITableView _configureCellForDisplay:forIndexPath:] is failing... becausecellForRowAtIndexPath is returning a null value and then configureCellForDisplay is expecting aUITableViewCell.
- UItableView Crash--Assertion failure
- *** Assertion failure in -[UITableView _endCellAnimationsWithContext:]
- *** Assertion failure in -[UITableView layoutSublayersOfLayer:]
- Assertion failure in -[UITableView layoutSublayersOfLayer:]
- 使用tableview的时候出现crash:Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
- Assertion failure in -[UITableView _endCellAnimationsWithContext:]---错误
- Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
- Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
- Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
- iOS Assertion failure in -[UITableView _classicHeightForRowAtIndexPath:]
- Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
- NSFetchedResultsController Assertion failure in -[UITableView _endCellAnimationsWithContext:]
- 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:]
- iOS Assertion failure in -[UITableView _classicHeightForRowAtIndexPath:]
- spring 学习笔记 引入通知
- Nginx rewrite
- make条件判断ifeq,ifneq,ifdef,ifndef
- Android Setting中添加是否有屏幕锁
- asp.net mvc数据标记国际化
- UItableView Crash--Assertion failure
- .Net多线程总结
- 字符串格式日期转成日期格式
- Hadoop异步rpc通信机制--org.apache.hadoop.ipc.Server
- SP运营攻略
- 积分图像
- vb.net入门——ComboBox 控件的使用
- [调试相关]android log类别
- CentOS 6.3安装配置JDK 1.6 和 Tomcat 7