【发布时间】:2014-05-04 10:36:12
【问题描述】:
我使用Storyboards 创建了我的项目。根ViewController 位于Storyboard 中,我没有在appDelegate 中写过任何代码。
现在我想展示我的应用程序的游览,所以我想将根 ViewController 从 Tab Bar 更改为我的 TourVC 并且当应用程序游览完成后,我想再次切换回我的根 @ 987654327@转Tab Bar。
于是我上网查了一下,按照以下几点进行
1) 从 app.plist 文件中删除 Storyboards,
2) 取消选中 Storyboards 中的选项“isInitialViewController”,在 Tab Bar 控制器的情况下进行检查,因为它是根 ViewController,
3) 在 appDelegate.m 文件中添加此代码。
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
ProductTourViewController *PT = [[ProductTourViewController alloc] initWithNibName:@"ProductTourViewController" bundle:nil];
self.window.rootViewController = PT;
[self.window makeKeyAndVisible];
return YES;
但是我的应用程序崩溃并显示此错误日志,
[ProductTourViewController selectedViewController]: unrecognized selector sent to instance 0x1766a9e0
我也收到了警告,
Unsupported Configuration: Scene is unreachable due to lack of entry points and does not have an identifier for runtime access via -instantiateViewControllerWithIdentifier:.
【问题讨论】:
标签: ios uiviewcontroller storyboard