【发布时间】:2011-05-04 13:21:49
【问题描述】:
我想显示自定义单元格,但我的代码一次只显示一个自定义表格单元格.. 我做错了什么?
我在 UIView 内设置了一个 UIViewController 笔尖,其中包含我的 UITableView。 nib 中还有一个 UITableViewCell,它的类是 CustomCell(UITableViewCell 的子类)。 UITableView 和 Cell 都是@sythesized 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;
}
【问题讨论】:
标签: iphone objective-c ios uitableview