0

I have a storyboard with a ViewController, embedded into NavigatonController (so the Storyboard shows one box with an arrow to another).

If I create my ViewController,

[storyboard instantiateInitialViewController:@"viewControllerID"]

it works, but the View is not within the NavController

If I create the Nav Controller from StoryBoard:

[storyboard instantiateInitialViewController:@"NavControllerID"]

I get an empty Navigationcontroller, without View.

How to achieve both?

Arnie Schwarzvogel
  • 955
  • 1
  • 13
  • 25
  • 1
    Show a screen shot of the storyboard (section), include the id of each controller. `instantiateInitialViewController:` isn't an existing method so show the real code you're using. – Wain Apr 29 '14 at 09:53
  • use this link http://stackoverflow.com/questions/23102978/swrevealviewcontroller-without-using-navigationcontroller/23105142#23105142 for navigate the particular view controller – Anbu.Karthik Apr 29 '14 at 09:53
  • 1
    You need to set the rootViewController for the UINavigationController. – Kumar KL Apr 29 '14 at 09:54
  • Sorry, not allowed to post pictures here yet. Will show the sources soon. – Arnie Schwarzvogel Apr 29 '14 at 10:09
  • @ArnieSchwarzvogel upload them to imgur or something like that and post the links here – Simon McLoughlin Apr 29 '14 at 10:21

1 Answers1

0

Ensure that the UIViewCotroller is embed as rootViewController to the UINavigationController .

 UIViewController *viewController = [self.storyboard instantiateViewControllerWithIdentifier:@"viewControllerID"];

 UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController: viewController]; // [storyboard instantiateInitialViewController:@"NavControllerID"];

Use the navigationController object to proceed

Kumar KL
  • 15,315
  • 9
  • 38
  • 60