Applications are expected to have a root view controller at the end of application launch

后端 未结 30 2100
野的像风
野的像风 2020-11-22 06:42

I get the following error in my console:

Applications are expected to have a root view controller at the end of application launch

30条回答
  •  忘掉有多难
    2020-11-22 07:40

    I also had this error but unlike any of the answers previously listed mine was because i had uncommented the method 'loadView' in my newly generated controller (xcode 4.2, ios5).

     //Implement loadView to create a view hierarchy programmatically, without using a nib.
    - (void)loadView  
    {
    }
    

    It even told me that the method was for creating the view programmatically but i missed it because it looked so similar to other methods like viewDidLoad that i normally use i didn't catch it.

    To solve simply remove that method if you are not programmatically creating the view hierarchy aka using nib or storyboard.

提交回复
热议问题