无法实例化 UIMainStoryboardFile 'Main' 的默认视图控制器 - 可能未设置指定的入口点? [英] Failed to instantiate the default view controller for UIMainStoryboardFile 'Main' - perhaps the designated entry point is not set?

查看:33
本文介绍了无法实例化 UIMainStoryboardFile 'Main' 的默认视图控制器 - 可能未设置指定的入口点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在新创建的应用程序中使用 Xcode,当我运行该项目时,它没有显示在 iOS 模拟器中,我收到以下消息:

I am using Xcode in a newly created app and when I run the project it does not show in the iOS Simulator and I get the following message:

未能为 UIMainStoryboardFile 'Main' 实例化默认视图控制器 - 可能指定的入口点未设置?

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

我当然在谷歌上搜索过,每个人都指出这是因为 Xcode 还不知道哪个视图控制器是初始的.但奇怪的是,我将应用创建为基于页面(也尝试过单视图和选项卡式应用选项)的应用,而 Xcode 已经为它定义了一个故事板.

I've Googled about it of course and everybody points out that this is happening because Xcode does not know yet which view controller is the initial one. But the weird thing is that I created the app as a page based (also tried single-view and tabbed app options) app and Xcode already had defined a Storyboard for it.

此外,当我转到项目的主界面选项时,故事板(Xcode 本身命名为Main")已设置,并且在故事板中,我的视图控制器设置为初始视图控制器"

Also, when I go to the main interface option of the project the storyboard (named "Main" by Xcode itself) is set, and in the Storyboard, my view controller is set as the "Initial View Controller"

怎么了?

推荐答案

所以这也发生在我身上.我检查了 50 次并且检查了我的是初始视图控制器",相信我.它突然发生了.那我是怎么修复的呢?

So this also happened to me too. I checked 50 times and my "Is Initial View Controller" was checked, believe me. It happened out of the blue. So how did I fix it?

  1. 在您的项目中创建一个新的故事板,将其命名为 Main_iPhoneV2(或 iPadV2,具体取决于您的原始故事板样式)
  2. 打开损坏的情节提要,单击白色区域的任意位置并按 command-a,然后按 command-c(全选并复制)
  3. 打开您的新故事板并按 command-v 粘贴完全相同的设置
  4. 转到您的项目设置,将您的主界面"更改为新的 Main_iPhoneV2(如果它是您的 iPad 并且您正在编写一个通用应用程序,则必须编辑 -Info.plist 并查找值主故事板文件基本名称 (iPad)
  5. 重新编译,不要再扯头发了

这篇关于无法实例化 UIMainStoryboardFile 'Main' 的默认视图控制器 - 可能未设置指定的入口点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆