我看到這個在這裏被問了很多次,但沒有一個解決方案的工作對我來說後消失內容。這裏是我的代碼片段:UITableView的自定義單元格滾動
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellClassName = @"DemoTableViewCell_sched";
DemoTableViewCell_sched *cell = [tableView dequeueReusableCellWithIdentifier:CellClassName];
if (cell == nil)
{
NSArray *topLevelItems = [cellLoader instantiateWithOwner:self options:nil];
cell = [topLevelItems objectAtIndex:0];
}
cell.fooData = [self.bugs objectAtIndex:indexPath.row];
return cell;
}
然後我在ViewDidLoad
cellLoader = [UINib nibWithNibName:@"DemoTableViewCell_sched" bundle:[NSBundle mainBundle]];
你是否檢查過你的單元格中是否指定了標識符? – 2013-02-10 15:07:38
是的。在自定義單元格中,我確定標識符是「DemoTableViewCell_sched」。我還應該檢查什麼? – user1235155 2013-02-10 15:16:34
[This thread](http://stackoverflow.com/a/36037259/4034301)爲我工作。偉大的解決方案..! – 2016-03-16 13:37:46