Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS: Main.storyboard references the initial view controller

I'm adding a new storyboard reference:

enter image description here But 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.

like image 478
user2924482 Avatar asked May 10 '17 20:05

user2924482


People also ask

How do I instantiate a view controller from storyboard?

In the Storyboard, select the view controller that you want to instantiate in code. Make sure the yellow circle is highlighted, and click on the Identity Inspector. Set the custom class as well as the field called "Storyboard ID". You can use the class name as the Storyboard ID.

How does Main storyboard connect to ViewController?

Create a new IBOutlet called shakeButton for your storyboard button in your ViewController. swift file. Select the shake button in Interface Builder. Then hold down the control button ( ⌃ ) and click-drag from the storyboard button into your ViewController.

What is initial view controller?

The initial view controller acts as an entry point into the storyboard. You are going to add and configure another view controller to the canvas and set it to be the initial view controller for the storyboard.


1 Answers

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.

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

checkbox

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

like image 189
TotoroTotoro Avatar answered Oct 12 '22 02:10

TotoroTotoro