嘿家伙, 我是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];
}
哈哈哈。谢谢。有效。 – Nathan 2010-12-02 05:38:58