[Leopard] Core Data migration does not find legacy model

  • Hi!

    I am trying to use Core Data model versioning and data migration.

    I started writing version 2.0 of my application using the existing 1.0
    model. Now that I have made changes to the model, I also created a
    mapping model. Reading files created prior to the model change works
    quite OK now (*). So I was pretty happy.

    Then I went to grab a real 1.0 file. And: it cannot be read. Logging
    output seems to show that Core Data found neither source nor
    destination model:

      MLogString(@"error: %@", *error);
      MLogString(@"sourceModel: %@", [[*error userInfo]
    valueForKeyPath:@"sourceModel.versionIdentifiers"]);
      MLogString(@"destinationModel: %@", [[*error userInfo]
    valueForKeyPath:@"destinationModel.versionIdentifiers"]);
      MLogString(@"reason: %@", [[*error userInfo]
    valueForKeyPath:@"reason"]);

    2007-11-01 22:46:26.189 HoudahSpot[7490:10b] Document.m:628 error:
    Error Domain=NSCocoaErrorDomain Code=134020 UserInfo=0x10d2470 "(null)"
    2007-11-01 22:46:26.190 HoudahSpot[7490:10b] Document.m:629
    sourceModel: (null)
    2007-11-01 22:46:26.191 HoudahSpot[7490:10b] Document.m:630
    destinationModel: (null)
    2007-11-01 22:46:26.193 HoudahSpot[7490:10b] Document.m:635 reason:
    (null)

    I have tried replacing the 1.0 model in my project with the actual 1.0
    model. They ought to be the same and probably are. Anyway it does not
    help.

    What can I infer from the 134020 error code?

    How come Core Data even goes to forget what the destination model
    ought to be?

    How could my fake 1.0 files be different from real 1.0 files given
    they were created using the exact same model?

    Pierre

    (*) As far as I can see, the beginEntityMapping:manager:error: method
    of my custom policies is not called. Wonder what I am doing wrong here?

    ---
    Pierre Bernard
    http://www.bernard-web.com/pierre
    http://www.houdah.com
previous month november 2007 next month
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    
Go to today