Currently, my iOS (6) application uses the Master-Detail view template, with some list elements being pre-populated. Users currently have the option to 'Edit' and add to ('+') the list. Is there a way of removing these buttons, to prevent the original list being changed?
1 Answer
Yes there is an easy way.
Find this code in MasterViewController.m
and remove these lines self.navigationItem.leftBarButtonItem = self.editButtonItem;
, self.navigationItem.rightBarButtonItem = addButton;
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
self.navigationItem.leftBarButtonItem = self.editButtonItem;
UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(insertNewObject:)];
self.navigationItem.rightBarButtonItem = addButton;
}
-
Thanks! This is just what I was looking for. Sorry I don't have enough rep to up vote your answer yet. Dec 12, 2012 at 16:05
-