0

I want to navigate to a UIViewController out of a UISplitViewController, when somebody will click on a table cell in the detail View controller.

Setting a segue to an UIViewController didn't work properly.

How can I exit the UISplitViewController and show a full-sized UIViewController and navigate back to the UISplitViewController? I want to display some details on the UIViewController.

Niklas
  • 23,674
  • 33
  • 131
  • 170

1 Answers1

1

Show the UIViewController on the UISplitViewController by using method.

[self presentModalViewController:viewController animated:YES];

Hope this helps.

Nameet
  • 650
  • 8
  • 20
  • I added: AppDetailsView *appDetailsView = [[AppDetailsView alloc] initWithNibName:@"AppDetailsView" bundle:nil]; [self presentModalViewController:appDetailsView animated:YES]; in didSelectRowAtIndexPath method. I finally get the error: Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle (loaded)' with name 'AppDetailsView'' – Niklas Jan 15 '13 at 12:10
  • @Niklas this code works for. I am not sure why it is giving you this error. Can you make sure you have the AppDetailsView.xib file in the project? – Nameet Jan 15 '13 at 12:34
  • Hmm I'm only having a storyboard and not a xib in the project. – Niklas Jan 15 '13 at 12:42
  • Initialize the viewController as follows: AppDetailsView *appDetailsView = (AppDetailsView *)[self.storyboard instantiateViewControllerWithIdentifier:@"AppDetailsView"]; instead of initWithNibName: – Nameet Jan 15 '13 at 12:55
  • Nice this is working for me, but i need to set the Storyboard ID in the Identity tab in the interface builder to AppDetailsView. – Niklas Jan 15 '13 at 13:02
  • do you know how to navigate back to the UISplitViewController? – Niklas Jan 15 '13 at 13:24
  • Use a delegate to dismiss the viewController like [this](http://stackoverflow.com/questions/12649834/dismissviewcontroller-not-working) – Nameet Jan 16 '13 at 06:00