今天 写数据库的时候 遇到 这么 一个问题
UITableView _configureCellForDisplay:forIndexPath:
Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
这个 的返回值 为NULL
最后加了句 判断 得到最终要的 结果
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *cellID = @"contactInfo";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
if (cell == nil) {
cell = [[UITableViewCell alloc]initWithStyle:(UITableViewCellStyleSubtitle) reuseIdentifier:cellID];
}
Contact *contact = [contacts objectAtIndex:indexPath.row];
cell.textLabel.text = contact.name;
cell.detailTextLabel.text = contact.number;
return cell;
}
cell 返回一个空值 但是 configureCellDisplay 又期望 有个值 所以 会出现 这个 问题。。。