tags:

views:

609

answers:

2

Hi,

I have an application that uses CoreData.

I previously had a class named Marker which was linked to the Marker entity in Core Data.

I renamed the Marker class to CoreDataMarker. So I created a new .xcdatamodel file with the new class name for the entity. Then I created a .xcmappingmodel and selected the old and the new .xcdatamodel files and it seemed to 'auto-setup' fine.

However, when I run my application it complains with: "Can't merge models with two different entities named 'Marker'". I understand that this happens, but I have no idea how to solve it.

Do you know how?

Thanks in advance!

A: 

You don't need a new xcdatamodel. Change the in the "Class" field in the entity description for your Marker entity to CoreDataMarker. That's all that's needed. The implementing class information does not require a schema migration.

Barry Wark
A: 

And make sure ONLY the current version of the data model (latest xcdatamodel file) is included in target and mapping model file. It looks like putting other model files are being done automatically based on information from xcmappingmodel file.

It is unintuitive but this was what worked for me.

Lukasz