0

When I push a view onto my view controller

- (void)tableView:(UITableView *)tableView
        didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
  AnotherViewController *anotherViewController = 
      [[AnotherViewController alloc] initWithNibName:@"AnotherView" bundle:nil];
  [self.navigationController pushViewController:anotherViewController animated:YES];
}

the RIGHT BUTTON ITEM of the navigationController DISAPPEARS.

Is there a way to make the self.navigationController.rightBarButtonItem STAY THERE like in the "Notes" application that comes with the iPhone?

bobobobo
  • 64,917
  • 62
  • 258
  • 363

2 Answers2

0

You can do that with

self.anotherViewController.navigationItem.rightBarButtonItem = self.parentViewController.navigationItem.rightBarButtonItem;

after you´ve pushed the ChildViewController

rockstarberlin
  • 1,853
  • 1
  • 18
  • 31
0

I don't believe you can without using undocumented classes. However, if you set the rightBarButtonItem property to an item that looks the same, there shouldn't be a big difference.

Grant Paul
  • 5,852
  • 2
  • 33
  • 36