0
我對傳遞給configureCall的單元對象發生了什麼感到有些困惑:atIndexPath:我可以看到發生了什麼,但發現它奇怪configureCall:atIndexPath:不返回一個UITableViewCell作爲返回值。從configureCall沒有返回值:atIndexPath:?
- (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]];
}
感謝丹,我只是好奇。 – fuzzygoat 2012-08-06 18:27:07