【发布时间】:2018-06-25 01:23:27
【问题描述】:
我使用 iOS5 和故事板,我创建了两个 ViewController,一个用于纵向,一个用于横向.. 我用两个“模态segue”连接了两个视图,这是我使用的代码:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
UIDeviceOrientation deviceOrientation = [UIDevice currentDevice].orientation;
if (UIDeviceOrientationIsLandscape(deviceOrientation))
{
[self performSegueWithIdentifier: @"aaaa" sender: self];
}
else if (deviceOrientation == UIDeviceOrientationPortrait)
{
[self performSegueWithIdentifier: @"ddd" sender: self];
}
return true;
}
如果我从纵向更改为横向,它可以工作,但是当我返回纵向视图时,它会崩溃并显示“没有标识符为 'ddd' 的 segue”,但它存在。
谢谢。
【问题讨论】:
-
您确定在界面生成器中将segue的标识符设置为ddd吗?
标签: iphone ios uiinterfaceorientation uistoryboardsegue