Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding storyboard to existing project

Tags:

I have created a project without support of storyboards, but later I have added a storyboard. Storyboard work well and i see it's contents when loading app in emulator.

Then I created a view controller (UIViewController), and my problem is I can't bind any control from storyboard to my controller.

So my question is how to connect my controller with storyboard.

like image 412
glebreutov Avatar asked Jan 23 '12 14:01

glebreutov


People also ask

How do I copy a storyboard from one project to another?

Select the View Controller in the storyboard and press Command + C to copy. Then press Command + V to paste in the second storyboard. Check the document outline to see where it was pasted to. Copy this and paste it in the second project's storyboard file.

How do I add something to my storyboard?

Add a new Tab Bar ItemDrag View controller into the storyboard. Drag Tab Bar Item into the newly created view controller, it will sit at the same level of the View .


1 Answers

Those exact steps (I am using XCode 4.5 and iOS 6.0 ):

  1. Add new storyboard to the project by File->New->File...->Userinterface->storyboard
  2. Go to project summary and select MainStoryboard and select the storyboard name you just created.
  3. From AppDelegate.m file in method didFinishLaunchingWithOptions, comment everything except last statement which returns YES.

That is all. Now you should see your Initial view as you launch the project.

like image 52
OSXMonk Avatar answered Oct 04 '22 12:10

OSXMonk