UIManagedDocument example / tutorial
Asked Answered
T

2

7

I have been trying very unsuccessfully to create a simple UIManagedDocument library style application (separate documents saved to iCloud).

I am confused with the following:

Do I subclass UIManagedDocument and set up the persistentStoreCoordinator, ManagedObjectModel & ManagedObjectContext within this subclass, or are these supposed to be configured within the AppDelegate (and if so, how do I go about refreshing the persistentStoreCoordinator to look at the new file - it seems that once that has read a persistentStore that I can't get it to read a new persistent store)?

Tenuis answered 2/1, 2012 at 22:26 Comment(1)
Here is a link to an example, includes a video showing the app working. ossh.com.au/design-and-technology/software-development/…Undergarment
A
0

Richard's example is an excellent example. I used it and the PragmaProg book on core data http://pragprog.com/book/mzcd2/core-data as a guide for creating my managed document module on github. See: https://github.com/dtrotzjr/APManagedDocument

My code makes use of iOS 7 iCloud Core Data behavior which I cannot comment on publicly until the NDA is lifted. Feel free to ping me directly if you have any questions.

Alpestrine answered 6/9, 2013 at 1:41 Comment(0)
T
0

I've just posted a project based on Rick Warren's example: MultiDocumentPlusUUID. In his "Syncing Multiple Core Data Documents Using iCloud" post, Rick writes:

Another bug often shows up when I start trying to pass changes back and forth between devices that both have the same file open. The first sync always seems to work--and it seems to work pretty well as long as each subsequent sync is in the same direction.

MultiDocumentPlusUUID compiles and runs on iOS 7.1b4, and can ping-pong updates to a given document successfully.

Tricuspid answered 21/1, 2014 at 21:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.