首页 > 代码库 > iOS 8 & Xcode 6:解决Failed to instantiate the default view controller for UIMainStoryboardFile 'Main'

iOS 8 & Xcode 6:解决Failed to instantiate the default view controller for UIMainStoryboardFile 'Main'

把默认Main.storyboard的默认scene(情景)删除后,拖入新的ViewController,并指定其关联的ViewController类,运行程序。控制台输出信息如下:

Failed to instantiate the default view controller for UIMainStoryboardFile ‘Main‘ - perhaps the designated entry point is not set?

原因是没设置初始化ViewController。在场景中找到需要充当初始化界面的视图控制器,在其Attributes Inspector(属性检查器)中找到View Controller分区,勾选Is Initial View Controller即可,如下图所示。

iOS 8 & Xcode 6:解决Failed to instantiate the default view controller for UIMainStoryboardFile 'Main'