2

In navigation bar I'm adding two right barButtonItems:

[self.navigationItem setRightBarButtonItems:@[firstBarButton,secondBarButton]];

Now when I click over firstBarButtonItem want to remove it. I know when I have only one UIBarButtonItem I do:

self.navigationItem.rightBarButtonItem = nil;

How do I do when the rightBarButtonItems are two?

luca
  • 36,606
  • 27
  • 86
  • 125

1 Answers1

5

Just set one of them:

[self.navigationItem setRightBarButtonItem:secondBarButton];

InsertWittyName
  • 3,930
  • 1
  • 22
  • 27
  • 1
    Thanks it's working now. I had to set self.navigationItem.rightBarButtonItem = nil; and only then [self.navigationItem setRightBarButtonItem:secondBarButton]; though – luca Jun 06 '14 at 12:27