【发布时间】:2016-01-05 07:47:29
【问题描述】:
我真的为这个简单的问题设计了结构。
我只是使用以下代码从一个视图控制器移动到另一个视图控制器。
homescreen *home;
home=[self.storyboard instantiateViewControllerWithIdentifier:@"home"];
[self presentViewController:home animated:YES completion:nil];
在AppDelegate 方法中尝试使用相同的代码。
UIStoryboard *storyboard;
sur= [storyboard instantiateViewControllerWithIdentifier:@"survey"];
[self.window.rootViewController presentViewController:sur animated:YES completion:nil];
当我使用这段代码时,我遇到了这个崩溃:
由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“应用程序试图在目标上呈现一个 nil 模式视图控制器
我不想让它成为根视图控制器,我只需要移动它。
【问题讨论】:
标签: ios objective-c appdelegate