I did add this code to my viewDidLoad
, the edit button showed up, but there is no minus button at the left side of the rows.
self.navigationItem.leftBarButtonItem = self.editButtonItem;
After swiping the row, the delete button shows up, but when I hit the edit button there is no minus sign.
What can cause the minus sign to not show up in my program?
Set your table view editing mode as,
[self.tableView setEditing:YES animated:YES];
do the above in the action method of your edit button in navigation bar.
Or just use,
- (void)setEditing:(BOOL)editing animated:(BOOL)animated {
[super setEditing:editing animated:animated];
[self.tableView setEditing:editing animated:animated];
}
If you want to show the delete button, you can implement the below code.
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
return UITableViewCellEditingStyleDelete;
}
For more details check the apple documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With