Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c PoptorootViewController已激活,导致应用程序在设备方向更改时崩溃_Objective C_Xcode_Poptoviewcontroller - Fatal编程技术网

Objective c PoptorootViewController已激活,导致应用程序在设备方向更改时崩溃

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"

我正在做一个基于导航的项目

要从A到B,我要这样做:

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