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
0
votes
1 answer

Saving the same UIManagedDocument on two different devices generates error

Should the same UIManagedDocument be open on both of my devices, and I save (using the following code): [self.documentDatabase.managedObjectContext performBlockAndWait:^{ STNoteLabelCell *cell = (STNoteLabelCell *)[self.noteTableView…
Adam Carter
  • 4,741
  • 5
  • 42
  • 103
0
votes
1 answer

Saving a UIManagedDocument - speed improvements

I have the following code which is used on my View Controller whenever its property 'document' (of type UIManagedDocument) is set. I'm not sure if other people do, but I find the notion of concurrency in Core Data very confusing, the documents have…
Adam Carter
  • 4,741
  • 5
  • 42
  • 103
0
votes
1 answer

Storing UIManagedDocuments when uibiquity container (iCloud) is not available

I've managed to understand how to incorporate UIManagedDocument into a simple test application and it works as expected! However, now I'm adding support to this basic application so it will work if the user does not want to use iCloud. So when the…
Adam Carter
  • 4,741
  • 5
  • 42
  • 103
0
votes
1 answer

iOS CoreDataTableViewController table when UIManagedDocument is created using saveToURL

I'm using Stanford's CoreDataTableViewController to display a dynamic table. How the app works: To add a row to this table, a child screen is popped for data entry, and when the child screen closes, the newly created managedObject is inserted, and…
iht
  • 692
  • 1
  • 8
  • 15
0
votes
1 answer

NSCFString _cfurl unrecognised selector sent to instance

I'm working with Core Data for ages. Currently I would like to learn more about UIManagedDocument. I've done several sample projects to learn more about it. Finally, I'm good to transfer this mechanism to the real projects. In the existing project,…
Anatoliy Gatt
  • 2,501
  • 3
  • 26
  • 42
0
votes
3 answers

Error/Crash when creating a UIManagedDocument in iCloud

In my project I use UIManagedDocument with CoreData and iCloud. There seems to be lots of bugs when creating a UIManagedDocument in iCloud - especially when there is no network service. But now I get some strange errors/app crash with network…
FrankZp
  • 2,022
  • 3
  • 28
  • 41
0
votes
2 answers

How to create a NSManagedObjectContext with a non nil parentContext?

How do you create a NSManagedObjectContext that has a non nil parentContext that runs on a different queue/thread? UIManagedDocument's managedObjectContext does have this, but I don't know how to replicate it without using UIManagedDocument. This is…
cfischer
  • 24,452
  • 37
  • 131
  • 214
0
votes
1 answer

Core Data saving child context in performBlock: removes undo stack

I'm making a drawing app. With each tap some core data entities are created. The user can hit the undo button and those clicks are undone one at a time. This works fine. The problem comes when some automated task is run. I have a button that creates…
Odrakir
  • 4,254
  • 1
  • 20
  • 52
0
votes
1 answer

Consistency between the same database accessed in the appdelegate and a view controller

I've been working with Core Data and UIManagedDocument lately, and have some questions. I've a UITableViewController in which I open a UIManagedDocument. Here I download info to the tableViewCotroller and save the info to the database and update the…
0
votes
1 answer

Fetch on Core Data works in simulator but not on device

I have an app where I present VC1 to pick a game and VC2 to submit plays for the selected game. When a user segues back from VC2 to VC1 I want to retain the game data for the game they were playing. Since it's iOS 6.0, I am using UIManagedDocument…
0
votes
1 answer

How to ensure UIManagedDocument is ready before NSFetchedResultsController method is called?

I am totally stuck on this one. My basic problem is that my: - (NSFetchedResultsController *)fetchedResultsController Method is crashing when it tries to read my Core Core entity, as the managedObjectContext / UIManagedDocument is nil. At the…
0
votes
0 answers

UiManagedDocument works fine in simulator, but UIDocumentStateSavingError on iPhone

I use a uiManagedDocument singleton as suggested here: http://adevelopingstory.com/blog/2012/03/core-data-with-a-single-shared-uimanageddocument.html the document is accessed by a fetchedResultsController and displayed in a tableViewController. +…
mflac
  • 353
  • 3
  • 16
0
votes
1 answer

Telling ViewController UIManagedDocument is ready to use?

I am creating or opening a UIManagedDocument in my AppDelegate, using completion handler blocks to notify me when the document is ready for use. // CHECK TO SEE IF MANAGED DOCUMENT ALREADY EXISTS ON DISK if([fileManager…
fuzzygoat
  • 26,573
  • 48
  • 165
  • 294
0
votes
1 answer

Is the managedObjectContext initialized before the managed document is created/opened

I am accessing Core Data using UIManagedDocument, what I want to know is that once I have instantiated the managedDocument (before creating or opening) it would seem that the managedObjectContext has been setup/initialized for future use. The reason…
fuzzygoat
  • 26,573
  • 48
  • 165
  • 294
0
votes
1 answer

Preload sqlite database creating by UIManagedDocument, running Ok in iphone simulator, refusing to work in iphone Device

I've been working on this problem for a week, and I googled and searched stack overflow, read about 40 posts, still can't fix my problem. here is what i did: 1.I wrote a testing app to create the sqlite database, and preload it with data. 2.I…
1 2 3
12
13