Reputation: 1335
I created a new singleView application without storyboard (say FirstProject) and another single view application with storyboard (say SecondProject)and then added a storyboard in the application which didn't have a storyboard previously. Then I went in the FirstProject and changed the class of the storyboard to the viewcontroller class in identity inspector. After that I opened other files in the two projects individually and made changes in the code to be same in the corresponding files in the two projects.
Now when I run the project which had storyboard at the time of creation shows a white blank screen but the other application (in which storyboard was added later) shows just a black screen with no errors and no warnings.. What is the difference in these two files?
What is it that I am missing. How to tell an application that it should now load its view from storyboard and not from a XIB file as there is none?
Upvotes: 3
Views: 1715
Reputation: 4533
I second the "Good Job" building from scratch to truly Grok storyboards.
You need to delete the template code and just return YES;
in application:didFinishLaunchingWithOptions:
Complete Process
return YES;
in application:didFinishLaunchingWithOptions:
Upvotes: 4
Reputation: 535140
The way that a storyboard application knows to use the storyboard at launch time is that the Info.plist file contains an entry pointing to the main storyboard. You need to set that up. The "Main storyboard file base name" (UIMainStoryboardFile
) must match the base name of the storyboard file; the system sees this and loads the designated storyboard file automatically as the app launches.
Also you need to make sure that the initial view controller in the storyboard is marked as the initial view controller.
Upvotes: 1