Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding buttons to navigation bar ios

I am trying to add two right buttons to the navigation bar. I tried adding using following ways but I get SIGABRT

  1. self.navigationController.navigationBar.items = navItemsArray;
  2. self.navigationItem.rightBarButtonItems = navItemsArray;

navItemsArray has two buttons of type UIBarButtonItem.

Can anyone help with this? I can't figure out what is wrong.

like image 369
pa12 Avatar asked Nov 08 '11 15:11

pa12


People also ask

How do I change my Apple navigation bar?

On your Mac, use Dock & Menu Bar System Preferences to change the appearance of the Dock, and to select items to show in the menu bar and in Control Centre. To change these preferences, choose Apple menu > System Preferences, then click Dock & Menu Bar .


1 Answers

self.navigationItem.rightBarButtonItems = navItemsArray;

works only in iOS 5.

like image 144
pa12 Avatar answered Oct 24 '22 02:10

pa12