iOS 7 - Failing to instantiate default view controller

前端 未结 16 2021
一生所求
一生所求 2020-11-28 03:08

I am using Xcode 5 in a newly created app and when I just create it I go for the run button e click on it, then the project gets built but it does not show in the iOS Simula

16条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-28 03:34

    I have experienced this with my Tab Bar Controller not appearing in the Simulator along with a black screen. I did the following in order for my app to appear in the Simulator.

    1. Go to Main.storyboard.
    2. Check the Is Initial View Controller under the Attributes inspector tab.

    If you accidentally deleted that view controller, or otherwise made it not the default, then you’ll see the error “Failed to instantiate the default view controller for UIMainStoryboardFile 'Main' - perhaps the designated entry point is not set?” when your app launches, along with a plain black screen.

    To fix the problem, open your Main.storyboard file and find whichever view controller you want to be shown when your app first runs. When it’s selected, go to the attributes inspector and check the box marked “Is Initial View Controller”. You should see a right-facing arrow appear to the left of that view controller, showing that it’s your storyboard’s entry point.

提交回复
热议问题