Note that there are some explanatory texts on larger screens.

plurals
  1. POUITableViewController subclass setEditing: never puts the tableView in editing mode
    primarykey
    data
    text
    <p>I am using a SplitViewController and Core Data. My Master view is a simple TableView like the SplitViewController template. I have these three methods:</p> <pre><code>- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { return YES; } // Override to support editing the table view. - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if (editingStyle == UITableViewCellEditingStyleDelete) { // Delete the row from the data source NSManagedObjectContext *context = [self.fetchedResultsController managedObjectContext]; [context deleteObject:[self.fetchedResultsController objectAtIndexPath:indexPath]]; [self saveContext]; } } - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath { return UITableViewCellEditingStyleDelete; } </code></pre> <p>I thought this would be enough to show the delete button when I swipe the row to delete it. What happens now is if you swipe it the first time and only the first time, the delete button shows up then disappears. If I swipe again, nothing happens. I need to restart the simulator in order for it to show again. On my TableViewCell, I have a UILabel and a UITextField. I thought maybe the UITextField would be intercepting the swipe, but I resized them so they are only on the left half just in case. </p> <p>Edit:</p> <p>So I still haven't figured out why this happens. I thought I would add an edit button to test if the tableView setEditing: even gets called. So in my action method, I do:</p> <pre><code>- (IBAction)setEditMode:(id)sender { [self.tableView setEditing:YES animated:YES]; } </code></pre> <p>This method does get called, but the tableView never gets in editing mode. All of this is in a subclass of UITableViewController. Is there something else i'm missing? Thanks!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload