试验书上的tableview例子,报错:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:'但是我在代码里面定义了的:
(UITableViewCell *)tableview:(UITableView *)tableView cellforrowatindexpath:(NSIndexPath *)indexpath
{
static NSString *simpletableidentifier=@"simpletableitem";
UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:simpletableidentifier];
if(cell==nil) {
cell=[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:simpletableidentifier];
};
cell.textLabel.text=[tabledata objectAtIndex:indexpath.row];
return cell;
}
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:'但是我在代码里面定义了的:
(UITableViewCell *)tableview:(UITableView *)tableView cellforrowatindexpath:(NSIndexPath *)indexpath
{
static NSString *simpletableidentifier=@"simpletableitem";
UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:simpletableidentifier];
if(cell==nil) {
cell=[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:simpletableidentifier];
};
cell.textLabel.text=[tabledata objectAtIndex:indexpath.row];
return cell;
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货