I created a toolbar in IB with several buttons. I would like to be able to hide/show one of the buttons depending on the state of the data in the main window.
I am currently running OS X Yosemite Developer Preview 7 and Xcode 6 beta 6 targeting iOS 7.1 and following solution works fine for me:
UINavigationItem
and UIBarButtonItem
sRun following code to remove
[self.navItem setRightBarButtonItem:nil];
[self.navItem setLeftBarButtonItem:nil];
Run following codes to add buttons again
[self.navItem setRightBarButtonItem:deleteItem];
[self.navItem setLeftBarButtonItem:addItem];