Core-Data migration half-not-working

88 views Asked by At

I have an app already running fine, with a data model. I am currently working on a new version of this app, with a new data model.

Here is what happens:

  1. when I install the new version on top of the old app (with RW access DB), the installation works fine.
  2. when I try install the new version without the old version on the device (or the old app with RO access DB), then it does not work.

I would like the installation to work in all cases. But I am not sure what is wrong.

Here is the error message I get when trying to install the app on a device without the old version installed:

2014-11-26 19:03:40.152 TheApp[9256:60b] (persistentStoreCoordinator):Error Domain=NSCocoaErrorDomain Code=134100 "The operation couldn’t be completed. (Cocoa error 134100.)" UserInfo=0x17e8b3a0 {metadata={
    NSPersistenceFrameworkVersion = 479;
    NSStoreModelVersionHashes =     {
        InitialList = <b67469ea dcde5008 887e8f41 417d8560 3e36a123 2d737e84 a64bade4 a8f5761b>;
    };
    NSStoreModelVersionHashesVersion = 3;
    NSStoreModelVersionIdentifiers =     (
        ""
    );
    NSStoreType = SQLite;
    NSStoreUUID = "04AB772F-ED6B-46BA-2929-481513806FA6”;
    "_NSAutoVacuumLevel" = 2;
}, reason=The model used to open the store is incompatible with the one used to create the store}
2014-11-26 19:03:40.155 TheApp[9256:60b] Unresolved error (null), (null)

The message says “reason=The model used to open the store is incompatible with the one used to create the store” but this does not happen when an old version of the app (with RW access DB) is installed.

0

There are 0 answers