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 9193755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:14:22+00:00 2026-06-17T21:14:22+00:00

I have had an existing data model with a single persistent store, and all

  • 0

I have had an existing data model with a single persistent store, and all is good.

Now, following the WWDC 2012 video “Using iCloud with Core Data” (#227), I’ve defined two configurations in my model, “Cloud” and “Local” while keeping the original “Default”. I’ve split my entities between “Cloud” and “Local”. In my code, I add just the two corresponding persistent stores:

  NSDictionary *options = @{NSMigratePersistentStoresAutomaticallyOption: @YES,
                            NSInferMappingModelAutomaticallyOption: @YES};
  if (![__persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType
                                                  configuration:@"Cloud"
                                                            URL:[self cloudPersistentStoreURL]
                                                        options:options
                                                          error:&error]) {
    NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
  }

  if (![__persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType
                                                  configuration:@"Local"
                                                            URL:[self localPersistentStoreURL]
                                                        options:options
                                                          error:&error]) {
    NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
  }

These are added just fine. Later, when running the app and I try to save some initial trial data as normal, the following exception is thrown:

NSUnderlyingException=Can’t resolve how to assign objects to stores;
some objects may have been assigned to stores; use [[managedObject
objectID] persistentStore] to find out what is going where now; use
[managedObjectContext assignObject:toStore:] to straighten things out

I’ve Googled pieces of this with no hits, and Apple’s troubleshooting Core Data document doesn’t appear to discuss this. I have no clue what can be causing this or where to look. Any thoughts?

  • 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-17T21:14:24+00:00Added an answer on June 17, 2026 at 9:14 pm

    Ensure that you have no relationships crossing from one store into another. Related entities must be located inside the same configuration.

    For example you have entity Book configured to be stored in Cloud and Author to be stored into Local. Both are related.
    When you now assign an Author to a Book and save, then CoreData cannot handle the relationship and will raise the error you are seeing.

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

Sidebar

Related Questions

I have had an online archive service for over a year now. Unfortunately, I
I have had a persistent problem with Visual Studio 2010 and any framework version
I have had a look all over, but it doesn't seem as though my
I have had many problems in Django (not all of them solved), but this
I have an existing table with data in it. foobar_table foo bar baz I
I have an existing project that uses Core Data, and I have 3 versions
I have a ModelForm field that is based on the following Model: class Phrase(models.Model):
I have a jQuery autocomplete fild which gets existing data from my MVC action.
I had an original data model that was used to create NSManagedObject subclasses. I
I have had to compile my app for the 4.0 sdk to run on

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.