我对传递给 configureCall:atIndexPath: 的单元格对象发生了什么感到有点困惑:我可以看到发生了什么,但奇怪的是 configureCall:atIndexPath: 没有返回 UITableViewCell 作为返回值。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellID = @"PLANETCELL_ID";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
if(cell == nil) ...
// POPULATE CELL NEW
[self configureCell:cell atIndexPath:indexPath];
return cell;
}
- (void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath {
Planet *managedPlanet = [[self fetchedResultsController] objectAtIndexPath:indexPath];
[[cell textLabel] setText:[managedPlanet name]];
[[cell detailTextLabel] setText:[managedPlanet type]];
}