0

My application setup is like this: I have a navigation controller (create in the app delegate) View 1 --Push--->View2---Push--->View3 ---Modal transit (slide up) --->View4 --->Push-->View5

What I want to do is to create a new navigation controller in View4 so that I can push to another view from view5

I didn't have experience of creating navigation controller in view other than root view controller.

Can someone give me some guide or instructions for how to implement it?

1
  • oh.... i have programmatically created it and its quite easy yourOrderViewController *postingVC = [[yourOrderViewController alloc] initWithNibName:@"yourOrderViewController" bundle:[NSBundle mainBundle]]; YourOrderViewController = postingVC; UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:postingVC]; [self presentModalViewController:navigationController animated:YES]; Commented Jun 4, 2012 at 4:41

2 Answers 2

2

Here is how I did it.

+ (UIViewController *)viewControllerWithNavigation
{
    id controller = [[**YOUR VIEW CONTROLLER** alloc] initWithNibName:**FOO** bundle:**BAR**];

    UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:controller];

    [controller release];
    return [navController autorelease];
}

I present this view over the root view controller using:

UIViewController *controller = [**YOUR VIEW CONTROLLER** viewControllerWithNavigation];
[self.window.rootViewController presentViewController:controller animated:YES completion:NULL];

You, of course, can present t over any view you want

Sign up to request clarification or add additional context in comments.

Comments

0

select view4 in your storyboard, and select the menu Editor -> Embeded In -> Navigation Controller. good luck.

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.