是的,我已經看過所有這個錯誤的其他職位。UITableView dataSource必須從tableView中返回一個單元格:cellForRowAtIndexPath:?
這是我的代碼:我在哪裏錯了?
- (UITableViewCell *)TableView:(UITableView *)myTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [_myTableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
cell.textLabel.text = [_cellArray objectAtIndex: indexPath.row];
return cell;
}
您的方法名稱錯誤? tableView不是TableView – limon 2013-04-30 17:03:59
哈哈,廢話!謝謝 – Jason 2013-04-30 17:05:06
我添加我的評論作爲答案。請接受,如果這可以幫助你。 – limon 2013-04-30 17:13:46