我有一个从nib文件加载的自定义UITableViewCell。一切正常,直到我向下滚动过去最后一个单元格,这样当我放开时,表格视图必须反弹回来。自定义UITableViewCell滚动过去顶部后消失
然后,列表顶部的单元格为空,并保持空白,直到手动刷新表格视图。
形象问题:iPhone屏幕截图] [1]
这里是我行的代码单元:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"TimeEntryCellIdentifier";
TimeEntryCell *cell = (TimeEntryCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"TimeEntryCell" owner:self options:nil];
for (id oneObject in nib) {
if ([oneObject isKindOfClass:[TimeEntryCell class]]) {
cell = (TimeEntryCell *) oneObject;
}
}
}
TimeEntry *aTimeEntry = [appDelegate.timeEntries objectAtIndex:indexPath.row];
cell.clientName.text = aTimeEntry.ClientName;
cell.category.text = aTimeEntry.CategoryName;
cell.hours.text = [NSString stringWithFormat:@"%@", aTimeEntry.Hours];
[TimeEntry release];
return cell;
}
任何想法?
[1]:在http://dl.nvthost.com.s3.amazonaws.com/Screen拍摄2.46.42 2011-02-18 PM.png
[1]:在http://dl.nvthost.com.s3.amazonaws.com/Screen拍摄2.46.42 2011-02-18 PM.png
这是作为调试过程的一部分放在那里。我删除它,仍然有同样的问题。 – JWright 2011-02-18 21:01:28