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.

Edit
Report