您正在调用NSMutableArray对象上的valueForKey,该对象应在NSManagedObject上调用
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
// Configure the cell...
NSManagedObject *recipe;
if (tableView == self.searchDisplayController.searchResultsTableView)
recipe = searchResults[indexPath.row];
else
recipe = recipes[indexPath.row];
cell.textLabel.text = [recipe valueForKey:@"name"];
NSString *description = [[NSString alloc] initWithFormat:@"%@ - %@", [recipe valueForKey:@"image"], [recipe valueForKey:@"prepTime"]];
cell.detailTextLabel.text = description;
return cell;
}