views:

54

answers:

1

I have a UINavigationController with a UITableViewController which has and two UIBarButtonItems:

- (void)viewDidLoad {
    [super viewDidLoad];


    self.navigationItem.leftBarButtonItem = self.editButtonItem;
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(showSubscribeSheet:)];

    self.navigationController.navigationBar.tintColor = [UIColor brownColor];
}

I want to hide self.navigationItem.rightBarButtonItem when the UITableView is in edit mode. What way can I do this? Thanks.


I do not use nibs.

A: 

Just set it to nil to hide it

self.navigationItem.rightBarButtonItem = nil ;

Sammy
I know but how can I do this whenever the `UITableView` enters or leaves edit mode? This means: when the Edit/Done button is tapped, or when a slide is performed on an editable `UITableViewCell` to delete it, and when that deletion is cancelled.
Time Machine