Visibility about the UIBarButtonItem in UINavigationItem
In Interface Builder, I did't give the UIBarButtonItem a title, then the UIBarButtonIt开发者_开发百科em was not appear when it was running. I want to control it in my code, but when I set the title property of UIBarButtonItem to @"", the bar button was not disappear instead. I don't know if there is a property to control the visibility of UIBarButtonItem in UINavigationItem. Thanks a lot!
Check out the UIBarButtonItem Class Reference.
You can also try self.navigationItem.leftBarButtonItem = nil;
精彩评论