UINavigationController,然后将window的rootviewcontroller指向UINavigationController。例如:
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:[QHSliderViewController sharedSliderController]];
self.window.rootViewController = nav;
但有时这种方法仍不起效,其原因就是nav的rootviewcontroller的问题,解决的办法是在rootviewcontroller中加载一个uiviewcontroller就可以解决
例如在nav的rootviewcontroller中增加一个LoginViewController 例如:
LoginViewController *vc1 = [[LoginViewController alloc] init];
viewControllersArray = @[[[UINavigationController alloc] initWithRootViewController:vc1]];
vc1.navigationController.navigationBarHidden = YES;
就能够解决UINavigationController为null的问题