I\'m trying to set up a list of items that can be edited. I have a main view, with a UINavigationBar at the top and a UITableView directly under it. I\'d like to have my \"edit\
set up nav button in IB with the following linked in IB and create an outlet called editOutlet and and an action called editToggle in your header file and your method is as easy as this:
-(IBAction) editToggle:(id) sender {
if (self.tableViewOutlet.isEditing == NO) {
self.editOutlet.title = NSLocalizedString(@"Done", @"Done");
self.editOutlet.style = UIBarButtonItemStyleDone;
[self.tableViewOutlet setEditing:YES animated:YES];
}else {
self.editOutlet.title = NSLocalizedString(@"Edit", @"Edit");
self.editOutlet.style = UIBarButtonItemStylePlain;
[self.tableViewOutlet setEditing:NO animated:YES];
}
}