转:Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
2013-06-13 18:08
387 查看
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.
转:http://blog.csdn.net/theonezh/article/details/8613593
相关文章推荐
- Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
- tableview 第一次可以查看tableview 当退出第二次却会出现Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
- Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
- Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
- Tableview出现Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
- Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
- Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
- 使用tableview的时候出现crash:Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
- Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
- *** Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:], /BuildRoot/Library/C
- 报错:*** Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:], /BuildRoot/Librar
- Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
- Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
- iOS:编译问题 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 -[SKSTableView _configureCellForDisplay:forIndexPath:]
- Assertion failure in -[UITableView dequeueReusableCellWithIdentifier:forIndexPath:]