当一个tableview加载不同的cell,且cell是xib类型时,需要以下方法,解决重用cell报错问题:
```
static NSString *CellIdentifier = @"Cell";
BOOL nibsRegistered = NO;
if ( !nibsRegistered ) {
UINib *nib = [UINib nibWithNibName:NSStringFromClass([Cell class]) bundle:nil];
[tableView registerNib:nib forCellReuseIdentifier:CellIdentifier];
nibsRegistered=YES;
}
Cell*cell = (Cell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
cell.titleLabel.text=[self.dataList objectAtIndex:indexPath.row];
return cell;
```