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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:40:30+00:00 2026-05-27T02:40:30+00:00

With this version of an iPhone app, I’m trying to create a new core

  • 0

With this version of an iPhone app, I’m trying to create a new core data model version in which I’m taking two existing entities and changing them to inherit from a brand new abstract entity. I’m also trying to move several of the shared properties from these entities onto the new abstract entity.

When I run on an existing version of the app I get a NSInternalInconsistencyException

Cannot merge multiple root entity source tables into one destination entity root table

Up until this version of the app I’ve gotten away with “lightweight” migration. Does this exception mean that I’ll need to create a Mapping Model?

  • 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-27T02:40:30+00:00Added an answer on May 27, 2026 at 2:40 am

    I’ve solved the problem. I’m going be detailed here so other people can use this as a resource. I’m not completely sure about the inner workings of core data, but it seemed to choke when trying to create a new abstract entity and have two existing entities merge into it. So the solution I came up with was to ditch the old entities and create 3 brand new ones and create a mappingmodel to map data from the old entities onto the new ones.

    Given the following entities that need to inherit from a new abstract entity.

    • Snake
    • Mouse

    Step 1 – create new model version

    Create a new model version and create 3 new entities. Delete the old ones. I used different names for the new entities. I’m not sure if there’s a way to accomplish this by keeping the names the same.

    • Serpent (replaces snake)
    • Rodent (replaces mouse)
    • Animal (new abstract entity that the other two will use as a parent)

    Note: it’s possible to copy and paste properties and relationships in the model designer view. You can copy them between entities and even across model versions. Just select properties from the property list in the designer view and ⌘-C. This is a big time saver when moving properties from the old entities onto the new abstract one.

    Step 2 – Create a Mapping Model

    Use Xcode to create a mapping model. In the creation dialog select the previous model version as the source and the new model version as the destination. The mapping model holds a list of entity mappings. Xcode should have automatically created one for each of the entities in your old model version. They follow the naming pattern of OldEntityToNewEntity. None of the new entities will have been created yet so you have to add them:

    • SnakeToSerpent

    • MouseToRodent

      (do not make one for the abstract Animal entity).

    In the property inspector for each of the new mappings select the old entity as the source and the new one as the destination.

    Step 3 – map the properties

    Some of the properties and relationships in each entity mapping should already be present. Any property that has the same name in both the old entity and the new one should have been automatically detected and setup correctly. You’ll have to add a property mapping for any property that got moved to the abstract entity. (same with relationships and fetched properties) Just reference your old model version to make sure you included all the properties you plan to continue using.

    That should be it.

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

Sidebar

Related Questions

I'm developing a Lite version of an existing iPhone app and I'm trying to
I'm working on an update for an already existing iphone app. The existing version
I am trying to make a lite version to my iPhone App. I followed
I dont want to go through the data migration with an existing iphone app.
I am creating an app which has version for both iPhone and iPad, iPad
I have just release a new version of my app to Apple which Apple
I'm releasing a new version of my iphone app and everything was going great
I'm trying to build a release version of my iPhone app in Xcode 4
I'm developing an iphone app that uses Core Data with a SQLite data store
This is a (very) simplified version of my iPhone code : @interface x {

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.