2
我得到這段代碼的錯誤。你能幫我弄清楚爲什麼。UITableView dataSource必須從tableView返回一個單元格:cellForRowAtIndexPath錯誤
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"CustomerCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
Restaurant *restaurant = [self.restaurants objectAtIndex:[indexPath row]];
[[cell textLabel] setText:[NSString stringWithFormat:@"%@ %@",restaurant.Name,restaurant.Address]];
return cell;
}
謝謝,工作完美! – user1426292 2012-07-24 03:20:23
@ user1426292太棒了!如果解決方案適合您,請考慮接受它,讓其他人知道您不再需要積極尋找改進的答案,並在Stack Overflow上獲得全新的徽章。 – dasblinkenlight 2012-07-25 20:15:13