Ah, so when it says "the method must derive the reference object from the
managed object’s values" it is talking about the managed object's persisted
values. So I could get rid of my extra attribute in my managed object class and
just set my UUID using a method similar to what you define below, and then just
persist that on all my objects.
It is possible that the file could be edited in the Windows version of the
application, or may be imported through an importer that doesn't add the IDs,
but I guess that wouldn't matter since I would set it the first time it was
asked for, and I would persist it after that.
Regards
Gideon
>
> The objectID value ("referenceObject") needs to be the same every time you
> load the document. If you open the document multiple times, and give the
> same objects different objectIDs, badness happens. For Save As, we're
> generating a dictionary of old IDs -> new IDs. When we add the new store to
> the coordinator, if the store hands back random values for the migrated
> objects, then the MOC can't fix its MOs to point to the new store's cache
> nodes.
>
> if you:
>
> (1) open the document
> (2) fetch all the objects into array 'results' (with a sort ordering)
> (3) NSLog(@"results = %@", [results valueForKey:@"objectID"]),
> (4) close the document
> (5) repeat steps 1-4
> (6) compare the 2 logs
>
> If the strings don't match, you're SOL.
>
_______________________________________________
Cocoa-dev mailing list ([email protected])
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/archive%40mail-archive.com
This email sent to [email protected]