You can also put the table view in edit mode, implement editingStyleForRowAtIndexPath: and return UITableViewCellEditingStyleInsert (which puts a green circle with a plus sign).
For instance...
- (IBAction)editButtonPressed { //toggle editing on/off... [tableView setEditing:(!tableView.editing) animated:YES]; } - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath { if (indexPath.row == 0) return UITableViewCellEditingStyleInsert; //gives green circle with + else return UITableViewCellEditingStyleDelete; //or UITableViewCellEditingStyleNone }
When the green button is pressed, the table view will call tableView:commitEditingStyle:forRowAtIndexPath: ::
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if (editingStyle == UITableViewCellEditingStyleInsert) {
source share