Initializing root view controller with myViewController / Using split view(sliding navigation) controller

StackOverflow https://stackoverflow.com/questions/10175573

  •  31-05-2021
  •  | 
  •  

Pergunta

I'm working on adopting slide (split) view controller to my project.

JT, DD, ZUUI, JW, ECS.....

All these sources suggesting initialize my root view controller in appDelegate.

Something like this....

MyMainViewController *controller = [MyMainController alloc] init];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:Controller];
   .........
self.window.rootViewController = viewController;
[self.window makeKeyAndVisible];

Problem is I can't make my view visible, my app show blank page only with a empty navigation bar.

I customized my main view using AQGrid, is this causing a problem?

My view looks different to storyboard look. (because I customized it.)

So when I do initialize I'm using "self.storyboard initialize......method".

But in appdelegate, I can't use that method.

Simply, I can't make this view hierarchy because when I initialize my view it is not visible.

    • ZUUIRevealController is parent of:
        • UINavigationController is parent of:
          • FrontViewController
Foi útil?

Solução

If you are using a storyboard, don't do any of that. Instead, choose your starting view controller from the storyboard and check the "Is Initial View Controller" in the Attributes inspector.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top