Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS UITableView is getting stuck in edit mode when reordering cells
    text
    copied!<p>iOS UITableView is getting stuck in edit mode when reordering cells</p> <p>When I click on Edit, edit mode enters correctly and when I click done it correctly gets out of edit mode.</p> <p>But when I drag and reorder cells, the table gets stuck in edit mode, see attached. The only way out of it is to kill the app.</p> <p>This is happing in iOS 6 and 7. </p> <p>Any suggestions would be appreciated.</p> <pre><code> - (IBAction)editAction:(id)sender { [self.tableView setEditing:YES animated:YES]; } - (IBAction)doneAction:(id)sender { [self.tableView setEditing:NO animated:YES]; } - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { return YES; } - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath { self.fetchedResultsController.delegate = nil; NSMutableArray *objects = [[self.fetchedResultsController fetchedObjects] mutableCopy]; id object = [self.fetchedResultsController objectAtIndexPath:fromIndexPath]; [objects removeObject:object]; [objects insertObject:object atIndex:[toIndexPath row]]; int i = 0; for (NSManagedObject *mo in objects) [mo setValue:[NSNumber numberWithInt:i++] forKey:@"displayOrder"]; objects = nil; [[self currentManagedObjectContext] MR_saveToPersistentStoreAndWait]; self.fetchedResultsController.delegate = self; [[self fetchedResultsController] performFetch:nil]; } </code></pre> <p><img src="https://i.stack.imgur.com/E5Qjk.png" alt="enter image description here"></p>
 

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