【发布时间】:2015-03-24 10:55:19
【问题描述】:
我想通了。感谢 shim 提供的信息!:
UIViewController* vc = (UIViewController*)[[UIStoryboard storyboardWithName:@"iPhone4" bundle:nil] instantiateViewControllerWithIdentifier:@"MyViewControllerIdentifier"];
if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"currentViewController"] isEqualToString:@"iPhone4Level1"])
{
[self.window setRootViewController: vc];
}
【问题讨论】:
-
提供有关崩溃的更多详细信息。它发生在哪里,它说什么,等等。
-
但是我的代码正确吗? @shim
-
@shim 查看我对 NSLog 的编辑
-
很高兴您更新了您的问题,但您真的不应该删除您的问题,以防将来的访问者想弄清楚您在问什么以及您尝试了什么不起作用。跨度>
标签: objective-c uiviewcontroller nsuserdefaults uistoryboard appdelegate