ios - How to set root view controller of window to a UINavingationController when current root view controller of window is UITabBarController? -
I have a UITabBarController that contains four navigation controllers. When the user taps a button , I want to set the root of the window a new navigation controller for the root viewController How do I do this in Objective-C?
Using a Model View Controller will look better than just substituting the root view controller, and as you would Seeing the same kind of effect should be generated. As a matter of fact, you make an example of your visual controller, add it to a new navigation controller, and then present the navigation controller in a fundamental way:
- pressed (zero) button {MyViewController * vc = [[MyViewController Alloc] init]; UINavigationController * nav = [[UINavigationController alloc] initWithRootViewController: vc]; [Self present ViewController: animated nav: yes complete: zero]; }
Comments
Post a Comment