我有3种不同的xib。我可以使用以下代码在视图1和视图2之间来回...
本守则提出了第二种观点......
-(IBAction)startButtonClicked:(id)sender{
self.gamePlayViewController = [[GamePlayViewController alloc] initWithNibName:@"GamePlayViewController" bundle:nil];
[self.navigationController pushViewController:gamePlayViewController animated:YES];
[GamePlayViewController release];
}
此代码在第二个视图中执行,并将我带回第一个视图......
- (IBAction为)backButtonClicked {
[self.navigationController popViewControllerAnimated:YES];
}
现在,当我尝试执行此代码(在第二个视图中)到达第三个视图时...我得到SIGABRT并且应用程序崩溃...为什么它适用于第一个视图调出第二个视图,但不是第二种观点提出第三种观点?
- (IBAction为)新思维{
self.thirdViewController = [[ThirdViewController alloc] initWithNibName:@"ThirdViewController" bundle:nil];
[self.navigationController pushViewController:thirdViewController animated:YES];
[thirdViewController release];
}
答案 0 :(得分:0)
在ThirdViewController.xib中可能存在一些您忘记配置或配置错误的对象或插座。比较和对比ThirdViewController.xib和GamePlayViewController.xib,密切关注你如何配置ThirdViewController.xib的类名和出口。特别是: