1

This is the structure of my application currently:

  • UIWindow
    • UIViewController (Root View Controller)
      • UINavigationController
      • UITableView
    • UIViewController (PresentModalViewControllerAnimated:YES)
      • UITableView

This is how I want it to be:

  • UIWindow
    • UIViewController (Root View Controller)
      • UINavigationController
      • UITableView
    • UIViewController (PresentModalViewControllerAnimated:YES)
      • UINavigationController
      • UITableView

I have a view that slides up and I want that view to have its own UINavigationController. It's for the app settings so I want to have nested options.

Any ideas how to do this?

The application type was a Navigation app to start with which is where the Root View Controller's UINavigationController came from.

1 Answer 1

1

Note that UINavigationController inherits from UIViewController so you can present it as a modal view controller. I've created a simple test application and this approach worked fine.

To present navigation controller:

ChildController* controller = [[ChildController alloc] initWithNibName:@"childController" bundle:nil];
UINavigationController* childNav = [[UINavigationController alloc] initWithRootViewController:controller];
[self presentModalViewController:childNav animated:YES];    
[controller release];
[childNav release];

Then to dismiss modal controller from whatever controller in its hierarchy use

[self.navigationController dismissModalViewControllerAnimated:YES];
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.