大家好,
我是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];
}
最佳答案
您要发布的不是data
的retain
。
关于iphone - 为什么第二次崩溃?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4332034/