title: Programmatically dismiss detail view controller in collapsed display?
body: <h2>Question</h2>
  
  <p>In a UISplitViewController collapsed display, how can I programmatically get back to master view controller? </p>
  
  <h2>Detail</h2>
  
  <p>I googled it but found no solution. Not sure if I was using the right keyword. This is how I show the detail view controller:</p>
  
  <pre><code>[self showDetailViewController:[[UINavigationController alloc] initWithRootViewController:detail] sender:self];
  </code></pre>
  
  <p>I also tried these 3 methods respectively, but none of them worked:</p>
  
  <pre><code>if (self.splitViewController.collapsed) {
          UIBarButtonItem *backButtonItem = self.navigationItem.leftBarButtonItem;
          (1):[backButtonItem.target performSelector:backButtonItem.action];
          (2):[[UIApplication sharedApplication] sendAction:backButtonItem.action to:backButtonItem.target from:nil forEvent:nil];
          (3):objc_msgSend(backButtonItem.target, backButtonItem.action);
  }
  </code></pre>
  
  <p>navigation items set like thie in detail VC viewDidLoad:</p>
  
  <pre><code>self.navigationItem.leftBarButtonItem = self.splitViewController.displayModeButtonItem;
  self.navigationItem.leftItemsSupplementBackButton = YES;
  </code></pre>