Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[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



_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.