• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Core Data merging
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data merging


  • Subject: Re: Core Data merging
  • From: Tim Isted <email@hidden>
  • Date: Fri, 15 Aug 2008 11:09:18 +0100

On 15 Aug 2008, at 00:19, Vadim Lozko wrote:

I'm having a problem trying to upgrade an existing store of a Core Data database to a newer model that simply has 1 additional attribute property in an entity. This is not a document based app. Also, not sure if this is significant, but the xcdatamodel and all related files are stored in a framework.

[...]

I tried to go about this two different ways. One was was to include only the newer model file and the mapping file to the build. However, the error I get is:
Error while adding persistent store: Error Domain=NSCocoaErrorDomain Code=134140 UserInfo=0x3c9030 "Persistent store migration failed, missing mapping model."

You do need to have the relevant data models inside your project, normally stored inside a datamodel bundle...


However, when I include all three files (both model and the mapping), it seems like it's trying to merge the two and ignore the mapping file altogether. The error I get is:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Can't merge models with two different entities named 'SomePrivateEntityName''

This particular problem is normally reasonably easy to fix.
Are you storing your data models in a data model bundle (filename.datamodeld)? You can then specify in Xcode which one is the current version. Assuming this is done, make sure that only one of your data models (the current version) has its target checkbox ticked, but don't tick any of the others. Sometimes you need to un-tick them all and re-tick them, or occasionally I've had to clean a project to get Xcode to accept and obey different ticks. If you have two data models (usually inside a bundle) included in the target and they have some or all of the same entity names inside, you will get this error if both models are being included in the target app.


HTH,
Tim
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Core Data merging
      • From: Vadim Lozko <email@hidden>
References: 
 >Core Data merging (From: Vadim Lozko <email@hidden>)

  • Prev by Date: Re: Making a bound view re-read its value
  • Next by Date: Re: Cocoa and SOAP without WebServicesCore
  • Previous by thread: Core Data merging
  • Next by thread: Re: Core Data merging
  • Index(es):
    • Date
    • Thread