When you edit UITableView, clicking the red dot does not display the "Delete" button

advertisements

A table view is contained in a regular view.
As expected, taping 'Edit' button (in that table view) displays 'red dot with minus sign' for each row (that is, method 'setEditing' executes OK).
However, clicking such red dot does NOT display the corresponding 'Delete' button ('commitEditingStyle' does NOT execute).
Any idea on what could be wrong (see relevant code below)?

//---- RootViewController.h ----
@interface RootViewController : UIViewController <NSFetchedResultsControllerDelegate> {    //used to be a 'UITableViewController'. Changed to UIViewController and rewired so I could add an iAd banner and the tableView to it. Before that change, issue was not present (commitEditingStyle below used to work).
...
}
@property (nonatomic, retain) IBOutlet UITableView *tableView;   

//----- RootViewController.m ----
- (void)viewDidLoad {
    self.navigationItem.leftBarButtonItem = self.editButtonItem;
    ...
}
- (void) setEditing:(BOOL)editing animated:(BOOL)animated {    //Added so clicking 'Edit' displays red dots that rotate on tap (as expected).
    [super setEditing:editing animated:animated];
    [self.tableView setEditing:editing animated:animated];
    if (editing) {
        NSLog(@"RootViewController setEditing");             //Executes OK.
    }
}
- (void)tableView:(UITableView *)tableView                  //Clicking a red dot no longer executes this method (so, does not display 'Delete' red button).
commitEditingStyle:(UITableViewCellEditingStyle)editingStyle
forRowAtIndexPath:(NSIndexPath *)indexPath {         

    NSLog(@"RootViewController commitEditingStyle");           //Does NOT execute.
    ...
}


Double check that you've wired up both your table's UITableViewDelegate and UITableViewDataSource correctly to the new UIViewController you've written.