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 know this answer is late for this question. However, it might help if anybody else faces a similar situation.
In iOS 7, to hide a bar button item, we can use the following two techniques :-
SetTitleTextAttributes :- This works great on bar button items like "Done", "Save" etc. However, it does not work on items like Add, Trash symbol etc.(atleast not for me) since they are not texts.TintColor :- If I have a bar button item called "deleteButton" :-To hide the button, I used the following code:-
[self.deleteButton setEnabled:NO];
[self.deleteButton setTintColor: [UIColor clearColor]];
To show the button again I used the following code:-
[self.deleteButton setEnabled:YES];
[self.deleteButton setTintColor:nil];