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

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

  •  31-05-2021
  •  | 
  •  

문제

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
도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top