【发布时间】:2010-12-02 05:36:35
【问题描述】:
大家好, 我是 Objective-C 的新手,我正在制作一个应用程序,当您单击表格单元格时,它会执行应有的操作,但是当您返回并第二次单击该单元格时,它崩溃了“ EXC_BAD_ACCESS”。你能告诉我这意味着什么,为什么它只是第二次崩溃,我该如何解决它?我很确定它在这个函数中:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// Navigation logic may go here. Create and push another view controller.
RaceData * data = [self.units objectAtIndex:indexPath.row];
ProtossInfo * info = [[ProtossInfo alloc] initWithNibName:@"ProtossInfo" bundle:nil];
// ...
// Pass the selected object to the new view controller.
[self.navigationController pushViewController:info animated:YES];
info.title = data.titler;
info.minerals.text = data.min;
info.vespene.text = data.vesp;
info.supply.text = data.sup;
info.portrait.image = data.porty;
[info release];
[data release];
}
【问题讨论】:
标签: iphone objective-c uitableview crash