【发布时间】:2012-02-03 01:46:18
【问题描述】:
我正在创建一个 UITableView,代码中的每一件事都很顺利,并且构建成功了,但是当我在模拟器中运行时。它显示错误为:
线程 1:程序收到信号:“EXC_BAD_ACCESS”。
在下面找到我的代码供您参考:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
UITableViewCell *cell =[tableView dequeueReusableCellWithIdentifier:@"Mycell"];
if(cell == nil){
cell =[[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"MYcell"]autorelease];
}
cell.textLabel.text=[NSString stringWithFormat:@"cell %@",(unsigned long)indexPath.row+1];
return cell;
}
错误在这一行:
cell.textLabel.text=[NSString stringWithFormat:@"cell %@",(unsigned long)indexPath.row+1];
请发表您的建议
【问题讨论】:
标签: iphone objective-c ios ipad uitableview