Objective c PoptorootViewController已激活,导致应用程序在设备方向更改时崩溃
我正在做一个基于导航的项目 要从A到B,我要这样做:Objective c PoptorootViewController已激活,导致应用程序在设备方向更改时崩溃,objective-c,xcode,poptoviewcontroller,Objective C,Xcode,Poptoviewcontroller,我正在做一个基于导航的项目 要从A到B,我要这样做: First *firstClass=[[First alloc] initWithNibName:@"first" bundle:nil]; [self.navigationController pushViewController:firstClass animated:YES]; 然后从B到C,我这样做: Second *secondClass=[[Second alloc] initWithNibName:@"Second"
First *firstClass=[[First alloc] initWithNibName:@"first" bundle:nil];
[self.navigationController pushViewController:firstClass animated:YES];
然后从B到C,我这样做:
Second *secondClass=[[Second alloc] initWithNibName:@"Second" bundle:nil];
[self.navigationController pushViewController:secondClass animated:YES];
Now, in C, I do this,trying to get back to A:
- (IBAction)goBack: (id)sender
{
[self.navigationController popToRootViewControllerAnimated:YES];
}
通过这样做,我可以成功地导航回A,但当我
在向后移动后更改设备的方向,因为当
第一次加载。有什么帮助吗?我们需要更多信息来帮助您。你能展示一下你的方向方法的实现吗?我只是在做这个-BOOLshouldAutorotateToInterfaceOrientation:UIInterfaceOrientationinterfaceOrientation{返回YES;}你没有实现新的旋转方法吗?自从iOS 6以来,shouldAutorotateToInterfaceOrientation已被弃用,并且有了新的方法:supportedInterfaceOrientation和shouldAutorotate.let