我正在创建分组表格视图。数据正在加载好,但在分组视图中有很多白色的空白空间。在我上下滚动几次之后,他们就会人口稠密。帮帮我?分组表格视图单元格不加载
这里是我的getCellForRowIndexAtPath
方法:
static NSString *Id= @"CustomDiagChargeID";
CustomCellDiagCharges *cell = (CustomCellDiagCharges *)[tableView dequeueReusableCellWithIdentifier:Id];
if(cell == nil) {
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"CustomCellDiagCharges" owner:self options:nil];
for (id oneObject in nib) {
if([oneObject isKindOfClass:[CustomCellDiagCharges class]])
cell = (CustomCellDiagCharges *) oneObject;
}
}
NSUInteger row = [indexPath row];
DiagDetails *rowData = [preferences getDiagElementAt:indexPath.section row:row];
cell.code.text = rowData.ICD9Code;
cell.desc.text = rowData.ICD9Desc;
return cell;
感谢,
Teja公司。
你可以在“NSUInteger row =”上面添加一个断言来确保你的单元格不是零? 另外,你可以尝试使用静态数据填充单元格吗?然后尝试使用类似[NSString stringWithFormat:@“Cell%d:%d”,indexPath.section,indexPath.row]; ?? – jessecurry 2010-04-11 01:49:22
试图填充静态数据,同样的问题。如果以某种方式更改内容,我正在使用分组tableView? – 2010-04-12 01:18:33