0

I would like to have three rightBarButtonItems on navigation bar. Add,Edit and Delete.

And I can't make it using Interface Builder.

Does anybody know how to do it programmatically?

Kinjal
  • 1,195
  • 4
  • 13
  • 24
  • Did you look at the docs for `UINagivationItem` and `rightBarButtonItems`? What specifically do you need help with? – rmaddy May 18 '15 at 17:13

1 Answers1

1

Add an array of bar button items to navigationItem.rightBarButtonItems

 UIBarButtonItem *searchButton         = [[UIBarButtonItem alloc]
                                             initWithBarButtonSystemItem:UIBarButtonSystemItemSearch
                                             target:self
                                             action:@selector(searchItem:)];

UIBarButtonItem *editButton          = [[UIBarButtonItem alloc] 
                                         initWithBarButtonSystemItem:UIBarButtonSystemItemEdit
                                         target:self action:@selector(editItem:)];

self.navigationItem.rightBarButtonItems =
[NSArray arrayWithObjects:editButton, searchButton, nil];
Sivajee Battina
  • 4,124
  • 2
  • 22
  • 45