我想顯示自定義單元格,但我的代碼只能一次顯示一個自定義表格單元格。我做錯了什麼?自定義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;
}