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

  • Home
  • SEARCH
  • 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 8489635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:52:55+00:00 2026-06-10T21:52:55+00:00

this morning we had a big trouble with our iphone app. We had to

  • 0

this morning we had a big trouble with our iphone app. We had to even take it off the store.

The thing is that we made real small changes to our xcdatamodel. We thought that the update process is automatically taking care about exchanging it the right way until we found out something like CoreData migration exists.

We are using the UIManagedDocument to connect to the persistent store.

How is it possible to exchange this file with the new one? While we were developing we just uninstalled the whole app from the device and then installed it again and everything worked. How can we simulate this process in the app store with updates?

UPDATE

I try to set the migration option like this

_database = [[UIIManagedDocument alloc] init];
NSMutableDictionary *options = [[NSMutableDictionary alloc] init];
[options setObject:[NSNumber numberWithBool:YES] forKey:NSMigratePersistentStoresAutomaticallyOption],

_database.persistentStoreOptions = options;

but the app is still crashing with

** Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘This
NSPersistentStoreCoordinator has no persistent stores. It cannot
perform a save operation.’


  • 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-06-10T21:52:56+00:00Added an answer on June 10, 2026 at 9:52 pm

    The key to this is managing multiple versions of your xcdatamodel file. One version is the current one and is used to open data stores created according to older versions. When doing so, you use a migration mapping to convert from one model to the other. This is all explained here.

    As to your questions: how you simulate the update process, actually you do not need to do anything special:

    1. install the older version;

    2. populate its data store with some data;

    3. install through Xcode the newer version on top of the older;

    The newer version will have the newer data model; when installed on top of the older version, it will find the older data store and will have to try and migrate it. This is exactly what happens when doing an update through the App Store: the app binary is replaced, but its sandbox data is kept intact, so the new binary will find it already there.

    Hope this helps.

    EDIT:

    Your code is shortened so I am not sure you have not yet, but you could try with:

    NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:
        [NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption,
        [NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption, nil];
    

    Also have a look at this post.

    On another coin, automatic migration will not always work, it depends on the kind of changes you made to the model; when it does not work, the you need specify a custom migration model. This is a very informative post about the topic.

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

Sidebar

Related Questions

We had a meeting this morning about how would should store our ID for
Woke up this morning with a page that our cluster was down. It came
This morning I had a look at my blog on my iPhone and noticed
I've been working on this iPhone app for a while now, and I had
I got a big problem this morning. My SQL Server had a HUGE bug
We had some problems this morning and need to rollback our database for about
I had a meeting with our president this morning who was wanting to have
I had a strange error in a VB6 app this morning and it all
It's just a stupid question that I had this morning : Can we use
Yesterday, I had programmed a simple Bluetooth network for my iPhone application. This morning,

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.