Questions tagged [uimanageddocument]

UIManagedDocument is a concrete subclass of UIDocument that integrates with Core Data. When you initialize a managed document, you specify the URL for the document location. The document object then creates a Core Data stack to use to access the document’s persistent store using a managed object model from the application’s main bundle.

The persistent store coordinator is set up automatically for you and you can configure it using it's persistentStoreOptions property. -you can use it as a data container, not just for documents. -you can listen to state and store content changes, which makes iCloud syncing easier

Read Apples documentation or an article by Erica Sadun. There is also a great demo video from Stanford Universities Paul Hegarty - check the Core Data demo on iTunes U.

188 questions
2
votes
1 answer

How to migrate an UIManagedDocument from iCloud enabled to Local Only in iOS7?

I am targeting iOS7 and I use iCloud with UIManagedDocument. I want to migrate an UIManagedDocument from iCloud enabled to Local Only. When the document is migrated I don't want any ubiquitous content related to it in the Cloud, I want it to be 100%…
nico9T
  • 2,496
  • 2
  • 26
  • 44
2
votes
0 answers

UIManagedDocument, iCloud and document types

I have an app that uses a UIManagedDocument (i.e., Core Data) document format. To keep life interesting I am trying to get it to work with iCloud. I have managed to get to the point where I can get one of the following two options: It works but in…
Stephen Darlington
  • 51,577
  • 12
  • 107
  • 152
2
votes
2 answers

What is the correct way to delete a UIManagedDocument?

I can't seem to find any reliable documentation that explains the correct procedure for deleting a UIManagedDocument, and in particular one where the iCloud options have been turned ON. I understand that this option would delete the file at this…
Duncan Groenewald
  • 8,496
  • 6
  • 41
  • 76
2
votes
1 answer

UIManagedDocument and CoreData

I have watched this years Stanford lectures, and have seen usage of UIManagedDocument for interacting with database. It seems very interesting, it seems much easier than usual way. I would like to use it, but i am unsure how... I know how to open…
MegaManX
  • 8,766
  • 12
  • 51
  • 83
2
votes
3 answers

One or many UIManagedDocuments

Ok, let's say I'm making a bird watch app. There's an "official" birds database. Which is stored in one UIManagedDocument. It's used to populate UITableView with all the birds and a little detailed view for each of them with pictures and data. This…
Odrakir
  • 4,254
  • 1
  • 20
  • 52
2
votes
1 answer

Does UIManagedDocument handle conflcts

Does UIManagedDocument handle row level conflcts for me or do I need to handle those, and his answer was it does handle row level conflicts. Maybe I misunderstood him but I am not seeing this. So I am going to ask a few key questions in hopes of…
dtrotzjr
  • 928
  • 5
  • 18
2
votes
0 answers

Unsure if UIManagedDocument is giving me a managed object context?

EDIT: based on the (very helpful) comment below, after further review, I'd just like to add (for other rookies like myself) that when using UIManagedDocument to obtain your core data functionality, pay attention to WHEN your instance is being opened…
vapul
  • 77
  • 8
2
votes
1 answer

Core Data duplicates when entries are updated but not saved

I'm trying to complete the Assignment 6 from course CS193P of Paul Hegarty. In a word, this is an iOS application used to browse photos downloaded from Flickr. The application has two tabs: The first tab is used to browse photos by tag. When you…
Florian
  • 23
  • 1
  • 4
2
votes
0 answers

UIManagedDocument & processing data in background thread

Would like to know what's the best/suggested way to process UIManagedDocument (Core) data in a background thread. Most questions are about adding new data in a background thread - I want to simply read them. I tried using the parentContext…
2
votes
1 answer

Open UIManagedDocument take too much time

Recently, I'm working with a timetable app in iOS, and i get trouble with Core Data. My app has a main user interface kind of like the original calendar app created by Apple, and i save all my events data in the Core Data database. I create a…
Jason J
  • 48
  • 3
2
votes
1 answer

UIManagedDocument documentState == 5, undefined state constant

While working with Core Data, I have found that my UIManagedDocument object has a documentState equal to 5. The UIDocument documentation only defines these constants: enum { UIDocumentStateNormal = 0, UIDocumentStateClosed =…
Jeff Lockhart
  • 5,379
  • 4
  • 36
  • 51
2
votes
2 answers

Core Data NSPredicate "deleted == NO" does not work as expected

I am using UIManagedDocument with Parent Child context. In my child context I do the following Code 1 NSSet *results = [self.event.memberships filteredSetUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(id evaluatedObject, NSDictionary…
krishnan
  • 782
  • 1
  • 9
  • 20
2
votes
1 answer

iOS 5.1 openWithCompletionHandler not suceeding

I'm attempting to make my iOS6.0 app back compatible with 5.1. I've turned off the obvious things (e.g. autolayout) but am getting stuck at a strange stage. My app takes data from an XML source and puts it in a core date structure. On iOS 6 this…
Nick Jones
  • 523
  • 1
  • 3
  • 17
2
votes
0 answers

How to recover a core data document when its state is UIDocumentStateSavingError.

I am using a file as the repo of my core-data. When trying to open it, I get a failure with the document state set to integer 5 (UIDocumentStateSavingError & UIDocumentStateClosed). How do I recover such a document, either by resolving the error or…
2
votes
2 answers

thread error with Core Data

I am developing an app that communicates with a server, and saves to core data. in appDelegate, I started my singleton object and called useDocument to initialize UIManagedDocument: - (void)useDocument { if (![[NSFileManager defaultManager]…
Chris Lin
  • 709
  • 2
  • 10
  • 20