How to set root view controller

后端 未结 4 645
长发绾君心
长发绾君心 2021-02-07 10:15

I set up an empty app with only an app delegate class, then subclassed a view controller class to create a xib to layout the app and make connections.

But when I tried

4条回答
  •  猫巷女王i
    2021-02-07 10:50

    Applications are expected to have a root view controller

    Replace in AppDelegate

     [window addSubview:[someController view]];
    

    to

     [self.window setRootViewController:someController];
    

提交回复
热议问题