简体   繁体   English

无法实例化默认视图控制器?

[英]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 . UINavigationControllersegue工作时,我也遇到了同样的问题。

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.

相关问题 无法实例化UIMainStoryboardFile'Main'的默认视图控制器 - Failed to instantiate the default view controller for UIMainStoryboardFile 'Main' 如何清除“无​​法实例化默认视图控制器”警告? - How to remove “Failed to instantiate the default view controller” warning? 从 .xcodeproj 切换到 .xcworkspace 后无法实例化默认视图控制器 - Failed to instantiate the default view controller after switching from .xcodeproj to .xcworkspace 无法实例化View Controller - Unable to Instantiate View Controller Xcode 11:无法使用标识符从 storyboard 实例化视图 controller - Xcode 11: cannot instantiate view controller from storyboard with identifier 在视图 controller 中实例化视图 controller 是否可能/智能? - Is it possible / smart to instantiate a view controller in a view controller? Swift-在AppDelegate中实例化视图控制器 - Swift - Instantiate View Controller in AppDelegate 在AppDelegate上实例化视图控制器,了解 - Instantiate a view controller on AppDelegate, understanding 无法为 UIMainStoryboardFile 'Main' 实例化默认视图 controller - 也许未设置指定的入口点? - Failed to instantiate the default view controller for UIMainStoryboardFile 'Main' - perhaps the designated entry point is not set? 未能为 UIMainStoryboardFile 'Main' 实例化默认视图 controller - 也许未设置指定的入口点? - Failed to instantiate the default view controller for UIMainStoryboardFile 'Main' - perhaps the designated entry point is not set?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM