Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 550471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:17:31+00:00 2026-05-13T11:17:31+00:00

I am using CoreData for my iPhone app, but CoreData doesn’t provide an automatic

  • 0

I am using CoreData for my iPhone app, but CoreData doesn’t provide an automatic way of allowing you to reorder the records. I thought of using another column to store the order info, but using contiguous numbers for ordering index has a problem. if I am dealing with lots of data, reordering a record potentially involves updating a lot of records on the ordering info (it’s sorta like changing the order of an array element)

What’s the best way to implement an efficient ordering scheme?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T11:17:31+00:00Added an answer on May 13, 2026 at 11:17 am

    FetchedResultsController and its delegate are not meant to be used for user-driven model changes. See the Apple reference doc.
    Look for User-Driven Updates part. So if you look for some magical, one-line way, there’s not such, sadly.

    What you need to do is make updates in this method:

    - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
     userDrivenDataModelChange = YES;
    
     ...[UPDATE THE MODEL then SAVE CONTEXT]...
    
     userDrivenDataModelChange = NO;
    }
    

    and also prevent the notifications to do anything, as changes are already done by the user:

    - (void)controllerWillChangeContent:(NSFetchedResultsController *)controller {
     if (userDrivenDataModelChange) return;
     ...
    }
    - (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath *)newIndexPath {
     if (userDrivenDataModelChange) return;
     ...
    }
    - (void)controllerDidChangeContent:(NSFetchedResultsController *)controller {
     if (userDrivenDataModelChange) return;
     ...
    }
    

    I have just implemented this in my to-do app (Quickie) and it works fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an iPhone app that is using CoreData. I recently made some minor
I'm creating a simple Navigation-based app using core data for my iPhone and I'm
I am using Core Data for my iPhone app. My attributes are set with
I've been creating an iPhone App using Core Data. First of all, does it
I'm making a Core Data app for the iPhone, but hope the question applies
I'm tinkering around with a iPhone word app where I am using a DAWG
What is a good way to handle iOS 4 app termination when using an
Using online interfaces to a version control system is a nice way to have
Using C# and System.Data.SqlClient, is there a way to retrieve a list of parameters
I'm working on an iPhone app that gets a number of objects from a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.