title: How do I set the title of the NavigationItem/NavigationBar
body: <p>I've been working on setting up a UI in Xcode that works similar to the iOS mail app, but the second popover view controller won't play along. I'm trying to set the title of the "Transactions" Navigation Bar to the name of the Account, but it instead sets the title for the DetailViewController:</p>
  
  <p>Before I choose an account: <a href="https://i.stack.imgur.com/zo75V.png" rel="nofollow noreferrer">http://i.stack.imgur.com/zo75V.png</a></p>
  
  <p>And After I choose the "New Account": <a href="https://i.stack.imgur.com/8DPBB.png" rel="nofollow noreferrer">http://i.stack.imgur.com/8DPBB.png</a></p>
  
  <pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  {
      Account *account = [[self fetchedResultsController] objectAtIndexPath:indexPath];
      self.transactionViewController.navigationItem.title = account.name;
  }
  </code></pre>
  
  <p>I use the above code to set the title, but the title is set for the wrong viewController...
  This same code produces no result at all for the iPhone version.</p>
  
  <p>EDIT:
  I actually found the answer to this in this guide: <a href="https://stackoverflow.com/questions/5210535/passing-data-between-view-controllers">Passing Data between View Controllers</a></p>
  
  <p>The key is to use the <code>-prepareForSegue:sender:</code> method to get the right viewController and set its title. This also allows you to pass any data from one ViewController to another whenever you use a segue to switch between them, which I now use to set the account for transactions and get the account name to set to the <code>seque.destinationViewController.navigationItem.title</code> property</p>
  
  <p>Thank you everyone for your help</p>