CoreData Stack Vs UIManagedDocument for iCloud Applications

I am trying to choose the best aproach for my iCloud-enabled CoreData app.

I think a good strategy is to create a SingleTon class to handle all CoreData and iCloud materials and deliver the ManagedObjectContext to the application.

This class should handle the case of a user changing an iCloud account or the case of iCloud is disabled. To do this, I need to work with several NSPesistentStores, one for iCloud, and one for iCloud is not available, and transfer data between them when necessary. is not it?

My main question is: what are the advantages and disadvantages of using the UIManagedDocument class or the traditional CoreData stack to create a singleton class that handles the core logic of the CoreData / iCloud application?

Can the sample code from WWDC 2012 also work with UIManagedDocument installed in the standard CoreData stack?

+4
source share
1 answer

Use what works best for your application ... it's pretty much up to you. UIManagedDocument works best for document-oriented applications (such as Apple iWork applications), and the use of the Core Data stack is directly improved for applications that are not.

The sample code from the WWDC 2012 227 session is better suited to your singleton idea - I'm not sure if this will work if you use UIManagedDocument , since this class manages its own Core Data stack.

+3
source

All Articles