Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]

时间:2023-03-09 17:57:51
Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]

今天遇到了Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]这个错误,一直也没有百度,不料想却弄了一个下午,唉,早知道就百度一下了,呵呵。

遇到这个问题的原因是tableView的这个方法返回了空的值,所以出错了

-(UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath
这个函数的返回值是个null!!
That's probably why [UITableView _configureCellForDisplay:forIndexPath:] is failing... becausecellForRowAtIndexPath is returning a null value and then configureCellForDisplay is expecting aUITableViewCell.