我想显示自定义单元格,但我的代码只能一次显示一个自定义表格单元格。我做错了什么?自定义UITableViewCell只绘制一个单元格
我有一个UIViewController的笔尖与UIView里面的UITableView设置。在nib中还有一个UITableViewCell,它的类是CustomCell(UITableViewCell的一个子类)。 UITableView和Cell都是@synthesized IBOutlet @properties。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
NSString *CellIdentifier = @"CellIdentifier";
CustomCell *cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; // CustomCell is the class for standardCell
if (cell == nil)
{
cell = standardCell; // standardCell is declared in the header and linked with IB
}
return cell;
}