I have added a right bar button item in my navigation item and want to remove this on some condition. This is what I am doing:
self.navigationItem.rightBarButtonItem = nil;
But not getting the desired behavior.
I want to hide it but do not find any method for it.
What you're doing should work. I've done that lots of times. Are you sure you're removing the button from the correct navigation item? Is self
the currently displayed UIViewController
?