xcode iOS:Main.storyboard 引用初始视图控制器

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/43901727/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 09:57:40  来源:igfitidea点击:

iOS: Main.storyboard references the initial view controller

iosxcodeinterface-builderuistoryboard

提问by user2924482

I'm adding a new storyboard reference:

我正在添加一个新的故事板参考:

enter image description hereBut I'm getting this error:

在此处输入图片说明但我收到此错误:

error: Main.storyboard references the initial view controller of newStoryBoard.storyboard, but no designated entry point was found.

any of you knows why I'm getting this error?

你们有人知道为什么我会收到这个错误吗?

I'll really appreciated your help.

我真的很感激你的帮助。

回答by Macondo2Seattle

This is a storyboard reference, pointing to another storyboard named newStoryBoard. For the segue to work, it needs to know which view controller it should open from that storyboard.

这是一个故事板引用,指向另一个名为newStoryBoard. 要使 segue 工作,它需要知道应该从故事板打开哪个视图控制器。

Open newStoryBoard.storyboard, select the appropriate view controller, and check the Is Initial View Controllerbox in the properties panel on the right:

打开newStoryBoard.storyboard,选择合适的视图控制器,并在右侧的属性面板中选中Is Initial View Controller框:

checkbox

复选框

Alternatively, you can set the Referenced Idin the storyboard reference properties. Set it to the storyboard Id of the view controller you want to open, and you should be all set.

或者,您可以在情节提要参考属性中设置参考 ID。将其设置为您要打开的视图控制器的 storyboard Id,您应该已经全部设置好了。