[英]cannot instantiate default view controller?
I have recently had an app rejected by Apple and when i attempted to make changes, my Main.storyboard was missing. 我最近有一个应用程序被Apple拒绝,当我尝试进行更改时,我的Main.storyboard丢失了。 I managed to delete the current reference and add an older version.
我设法删除了当前参考并添加了旧版本。 After some tweaking, I restored the storyboard.
经过一些调整后,我恢复了情节提要。 (ALWAYS HAVE BACKUPS, KIDS)
(总是有备份,孩子)
I tried to run the new version, XCode could not find the first ViewController. 我尝试运行新版本,XCode找不到第一个ViewController。
2014-09-13 22:18:42.453 Pong![1313:60b] Failed to instantiate the default view controller for UIMainStoryboardFile 'Main' - perhaps the designated entry point is not set?
2014-09-13 22:18:42.453 Pong![1313:60b]无法实例化UIMainStoryboardFile'Main'的默认视图控制器-也许未设置指定的入口点? Terminating in response to SpringBoard's termination.
因应SpringBoard的终止而终止。
I have checked the box "Is initial ViewController" but to no avail. 我已经选中了“是初始ViewController”框,但无济于事。
I too have faced the same problem while working in UINavigationController
and segue
. 在
UINavigationController
和segue
工作时,我也遇到了同样的问题。
The reason for this error is, the X-code
complier can't able to find the initial starting view controller . 发生此错误的原因是,
X-code
编译器无法找到初始的启动视图控制器 。
Solution: 解:
There is no need to create new storyboard. 无需创建新的故事板。 Just select the view controller in your current story board which you wanna to make as initial one.Then click Attribute inspector icon on top right corner and make a tick of
Is initial view controller
. 只需在当前故事板中选择要用作
Is initial view controller
。然后单击右上角的“属性检查器”图标,并勾选“ Is initial view controller
。
Now Rebuild and Run app. 现在重建并运行应用程序。
I had to create a new Storyboard file then copy it, then change the Main Interface option to the new one. 我必须创建一个新的Storyboard文件,然后将其复制,然后将Main Interface选项更改为新文件。 The old "Main" was deleted.
旧的“主要”已删除。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.