title: Check if controller has already been loaded XCode
body: <p>I have the following code to push a new ViewController in a Split View Controller:</p>
  
  <pre><code>Level4ViewController *controller = [[Level4ViewController alloc] initWithNibName:@"ModuleViewController" bundle:nil];
      [[detailViewController navigationController] pushViewController:controller animated:YES];
      [controller release], controller = nil;
  </code></pre>
  
  <p>The only problem I have, if I were to run this again, a new controller will show, I would like to be able to go to the view that I had before with all my data.</p>
  
  <p>Can anyone help me out here.</p>
  
  <p>Thanks.</p>
  
  <p>EDIT:</p>
  
  <p>Updated code?</p>
  
  <pre><code>Level4ViewController *controller;
      for(UIView *view in self.navigationController.viewControllers)
      {
          if([view isKindOfClass:[Level4ViewController class]])
          {
              controller = view;
              if(controller == nil)
              {
                  controller = [[Level4ViewController alloc] initWithNibName:@"ModuleViewController" bundle:nil];
              }
              else {
                  controller = [self.navigationController.viewControllers objectAtIndex:1];
              }
  
          }
      }
  
      [[detailViewController navigationController] pushViewController:controller animated:YES];
      [controller release], controller = nil;
  </code></pre>