我正在使用xcode 5.1.1与故事板。我在主菜单上有一个按钮,并使用此代码弹出到另一个视图控制器
VC *secondVC = [[VC alloc] init]; [self presentViewController:secondVC animated:YES completion: nil];
那里我有这个代码的返回按钮
[self dismissViewControllerAnimated:YES completion: nil];
而当我弹出二维码xcode给我的时候是错误的:
Presenting view controllers on detached view controllers is discourage
<UINavigationController: 0x8c94510>
.
我也有旋转问题,它不能正常工作。
解决方法
如果您想在viewWillAppear中推送,呈现或弹出视图控制器,则会出现此警告。我不知道你的代码是什么,所以很难确定你的问题,但尝试使用这个,如果你试图在viewWillAppear中显示新的视图。
[self performSelector:@selector(yourMethod) withObject:nil afterDelay:0.0];