Abhinav Abhinav - 2 years ago 142
Objective-C Question

Removing right bar button item from navigation item

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.

Answer Source

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?

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download