I need both insertion and deletion options so…
self.navigationItem.rightBarButtonItem = self.editButtonItem;
UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(addItem:)];
self.navigationItem.leftBarButtonItem = addButton;
Thats all good so far. I am done programming with “deletion” but having trouble with “insertion”
- (void)addItem:sender {
}
What do I add inside this addItem to start “Editing mode” and change my EditingStyle to UITableViewCellEditingStyleInsert? What the hell is that iteminputcontroller as seen in the apple library? There’s no explanation on that and help is vague online 🙁
Invoke setEditing function of your
tableViewinside youraddItemmethod.Should be like below.
Return
UITableViewCellEditingStyleInsertfrom youreditingStyleForRowAtIndexPathmethod.Update the data model according to edit actions delete or insert.