是的,我已经看过所有这个错误的其他职位。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