If you want the static name to be possible now (that is, in Xcode 4.6.3), this can be done on the Storyboard by simply setting the title in the navigation bar on the corresponding view controller.
If, however, you want the title of the navigation bar to change according to what is being viewed, for example, with a certain row of a particular row of the table, as far as I know, this should be set programmatically.
It took FOREVER (beginner, sigh!) To figure out how to change Julian Vogels' correct answer in order to trigger the key that I wanted to use. Here's what worked:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([[segue identifier] isEqualToString:@"DetailSegue"]) { // Fetch Item NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow]; NSDictionary *item = [self.groceries objectAtIndex:[indexPath row]]; // Configure Detail View Controller TPDetailViewController *vc = [segue destinationViewController]; vc.navigationItem.title = [item objectForKey:@"name"]; [vc setItem:item]; }
user3528000
source share