title: Adding a UINavigationController to my segue.destinationViewController in Objective-C
body: <p>I have a SplitViewController based app which calls to others UIViewController for being them displayed by replacement in the detail section...</p>
  
  <p>I send them parameters, info, objects and everything works fine by using segues from MasterViewController</p>
  
  <p>But some of my UIViewControllers interact with other UIViewControllers by using Segues, so, for making them working fine I need to embed them inside a UINavigationController</p>
  
  <p>my question is:</p>
  
  <p>How to add a UINavigationController to my segue.destinationViewController when segue is being executed for:</p>
  
  <ol>
  <li>Passing them my parameters from masterViewController</li>
  <li>Allowing my UIViewControllers to interact with other ViewControllers by Using Segues</li>
  </ol>
  
  <p>I thought in a solution: 
  -The parameters issue by creating custom delegates or protocols, in MasterViewController
  -The UINavigationControllers issue by adding them in design mode in storyboard by embedding my UIViewControllers in them </p>
  
  <p>but I need to set to my destinationViewController the UISplitViewController's delegate for displaying the button that shows the MasterViewController in portrait mode... </p>
  
  <p>if I set that in prepareForSegue method, having the UINavigationControllers Holding my ViewControllers, I will be setting the UISplitViewController's delegate to the UINavigationController instead</p>
  
  <p>thanks in advance for the help</p>
  
  <hr>
  
  <p><strong>EDIT:</strong> this was the way I found to solve it:</p>
  
  <p>First I assigned a IBAction to a Button, if my device is not an iPad it will do the normal segue...</p>
  
  <pre><code>- (IBAction)openExecutives:(id)sender {
      if ([[[UIDevice currentDevice]model] hasPrefix:@"iPad"]) {
          UsersListVC    *rightViewController    = [self.storyboard instantiateViewControllerWithIdentifier:@"UsersListVC"];
          [self showSplitViewController:rightViewController];
      }
      else
          [self performSegueWithIdentifier:@"viewSceneExecutives" sender:self];
  }
  </code></pre>
  
  <p>This is the function I developed for creating the SplitView with my custom detail...</p>
  
  <pre><code>-(void)showSplitViewController:(id)rightViewController{
  
      UIStoryboard *mainStoryboard        = [UIStoryboard storyboardWithName:@"iPad2" bundle: nil];
  
      UINavigationController  *leftNavController;
      UINavigationController  *rightNavController;
  
      MainMenuVC      *leftViewController     = [mainStoryboard instantiateViewControllerWithIdentifier:@"MainMenuVC"];
  
      leftNavController                   = [[UINavigationController alloc] initWithRootViewController:leftViewController];
      rightNavController                  = [[UINavigationController alloc] initWithRootViewController:rightViewController];
  
      leftNavController.toolbarHidden     = FALSE;
      rightNavController.toolbarHidden    = FALSE;
  
  
      UISplitViewController   *splitViewController    = [[UISplitViewController alloc] init];
  
      splitViewController.viewControllers             = [NSArray arrayWithObjects:leftNavController, rightNavController, nil];
  
      splitViewController.delegate        = rightViewController;
  
      self.view.window.rootViewController = splitViewController;
  }
  </code></pre>
  
  <p>All I did is redraw the splitViewController from the very beggining by creating a function which requires a parameter (UIViewController)</p>