Advertisement
RRK

Reorder cells

RRK
Nov 2nd, 2012
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
  2. {
  3. NSMutableArray *allFRCObjects = [[self.frc fetchedObjects] mutableCopy];
  4.     // Grab the item we're moving.
  5.     NSManagedObject *sourceObject = [self.frc objectAtIndexPath:fromIndexPath];
  6.  
  7.     // Remove the object we're moving from the array.
  8.     [allFRCObjects removeObject:fromIndexPath];
  9.     // Now re-insert it at the destination.
  10.     [allFRCObjects insertObject:sourceObject atIndex:[toIndexPath row]];
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement