title: Moving UITableView cells and maintaining consistent data
body: <p>I've enabled editing mode and moving cells around to allow users to position table view content in the order they please. I'm using Core Data as the data source, which sorts the content by the attribute "userOrder". When content is first inserted, userOrder is set to a random value. The idea is that when the user moves a cell around, the userOrder of that cell changes to accomodate its new position. The following are problems I am running into while trying to accomplish this:</p>
  
  <ol>
  <li><p>Successfully saving the the new location of the cell and adjusting all changed locations of influenced cells.</p></li>
  <li><p>Getting the data to be consistent. For example, the TableView handles the movement fine, but when i click on the new location of the cell, it displays data for the old cell that used to be that location. Data of all influenced cells gets messed up as well.</p></li>
  </ol>
  
  <p>I know I have to implement this in:</p>
  
  <pre><code>- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath {}
  </code></pre>
  
  <p>I just don't know how. The apple docs are not particularly helpful if you are using Core Data, as in my situation.</p>
  
  <p>Any guidance greatly appreciated!</p>