I have a usual editButtonItem in my navigationBar (created by the system), and I’d like to change its name. Si I wrote this lines in my TableViewController :
- (void)viewDidLoad
{
[super viewDidLoad];
[Some code...]
self.navigationItem.rightBarButtonItem = self.editButtonItem;
self.navigationItem.rightBarButtonItem.title = @"New name";
}
That works, but when entering and exiting the Edit Mode, its system name is restored.
I tried to force it again in didEndEditingRowAtIndexPath for example, but with no success…
What should I do to fix this custom name without having to build the button from start by myself in the code ?
@Bojan’s method is close but very inefficient, since it gets called for every single row. Just change the title at the beginning on
viewDidLoadand in addition do this: