Mailing Lists: Apple Mailing Lists

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

Re: CoreData - how to write new kind of PersistentStore?



On Apr 30, 2005, at 12:44 AM, Todd Blanchard wrote:
It would appear from the docs that the protocol for PersistentStore itself is undocumented and that there is no api on NSPersistentStoreCoordinator for registering new kinds of PersistentStores.

Is this simply a case of the docs lagging the code, or is CoreData pointlessly limited in this way? Having the ability to add new PersistentStores would be the key to allowing the use of CoreData with legacy file formats.

Core Data 1.0 does not include a public persistent store API. To convert a legacy file format is mostly a matter of reading that format and converting the read data into a managed object graph.


If you want read/write access to a legacy file format, the in memory store is quite useful for this task. The managed object context and persistent store coordinator contain all of the methods necessary to receive notification of all changes to an object graph and to react when the graph is saved to the memory store. At that moment in time, writing to a legacy file format is a matter of walking the in- memory object graph and writing the legacy format.

b.bum


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >CoreData - how to write new kind of PersistentStore? (From: Todd Blanchard <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.