iosiphoneobjective-cxcodexcode5

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


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:

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

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.

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"

Is Initial View Controller

What is wrong?


Solution

  • 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. Create a new Storyboard in your project, name it something like Main_iPhoneV2 (or iPadV2 depending on your original storyboard style)
    2. Open the broken storyboard, click anywhere in the white area and press command-a, then command-c (select all and copy)
    3. Open your new storyboard and press command-v to paste the same exact setup
    4. Go to your project settings, change your "Main Interface" to the new Main_iPhoneV2 (If it's your iPad and you're writing a universal app, you'll have to edit the -Info.plist and look for the value "Main storyboard file base name (iPad)
    5. Recompile, and stop pulling your hair out