【发布时间】:2013-11-05 19:03:28
【问题描述】:
我知道这可能看起来像重复,但这并不是因为我发现的所有问题/帖子都与我的无关,或者不起作用。
这就是我所拥有的。我的根视图控制器是一个拥有左、主和右视图控制器的 HoldingViewController。在我的主视图控制器中,视图确实加载了,如果用户还没有看到教程,我会启动一个教程视图控制器。我关闭视图控制器时遇到的问题是Warning: Attempt to present <TutorialViewController: 0xade1780> on <HoldingViewController: 0xaaaa500> while a presentation is in progress!
主视图控制器视图中的调用确实加载了:
if(![[NSUserDefaults standardUserDefaults] valueForKey:@"hasSeenTutorial"])
{
[[NSUserDefaults standardUserDefaults] synchronize];
GRxTutorialViewController *grxTutorialViewController = [[GRxTutorialViewController alloc]
initWithNibName:@"GRxTutorialViewController" bundle:[NSBundle mainBundle]];
grxTutorialViewController.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentViewController:grxTutorialViewController animated:NO completion:nil];
}
在教程视图中,我创建了一个按钮来关闭这个模态视图控制器。它是:
-(void)skipIntro
{
NSLog(@"Skip pressed");
[self dismissViewControllerAnimated:YES completion:nil];
}
我也尝试将 HidingViewController 的 viewDidLoad 放入其中,但它甚至不显示它,并且记录了以下消息:
Warning: Attempt to present <TutorialViewController: 0xaac0ed0> on <HidingViewController: 0xaabe8d0> whose view is not in the window hierarchy!
有没有人知道如何解决问题或我的问题是什么以及我做错了什么?任何帮助表示赞赏。提前致谢!
【问题讨论】:
-
我假设您在某些时候将 hasSeenTutorial 值设置为 true 并将其存储在 nsuserdefaults 中(在关闭教程之前)?
-
你能给答案投票吗? :)
标签: ios objective-c cocoa-touch debugging uiviewcontroller