Hiding UINavigationItem's bar button

Sreehari picture Sreehari · Aug 4, 2009 · Viewed 29.3k times · Source

I have added a BarButton item to the left of the nav.bar through Interface Builder and in the code I want this only to show in my table view's edit mode. But I didn't find any hidden property to set the leftBarButtonItem (like: self.navigationItem.leftBarButtonItem.hidden = YES).

I can only set enabled property. Anybody know how to control the hide and show property of the leftBarButtonItem, please help.

Answer

Adrian Avendano picture Adrian Avendano · Nov 11, 2009

This works I tried it myself

self.navigationItem.leftBarButtonItem = nil;
self.navigationItem.hidesBackButton = YES;