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

CoreData Stack Vs UIManagedDocument on iCloud Apps

I'm trying to choose the best aproach for my CoreData App with support to iCloud. I think a good strategie whould be creating a SingleTon class to handle all the CoreData and iCloud stuff and delivery a ManagedObjectContext to the App. This class…
3
votes
1 answer

How do you handle a UIManagedDocument?

First off, I should mention that this is my first post on this site. I am trying to teach myself to program iOS and in my google searches for answers I find that I'm constantly directed here. So thank you to all who have contribute here. You have…
caseyburden
  • 61
  • 1
  • 6
3
votes
1 answer

How to get UIManagedDocument to show up as a file package and not a folder

I'm working on a Core Data document based application, using a UIManagedObject subclass as my storage container. When saving the file (to iTunes File Sharing) the file shows up as a folder, instead of a file package. I'd like it to show up as a…
olynoise
  • 2,016
  • 2
  • 19
  • 32
3
votes
1 answer

What am I missing to get my iOS app entitled for iCloud?

I'm trying to add iCloud functionality to an existing app. I'm using UIManagedDocument to reference Core Data. I've put a fair amount of research into this and I can't figure out what I'm doing wrong. I've tried getting this to work on my Macbook…
Kurt Anderson
  • 932
  • 1
  • 10
  • 26
3
votes
1 answer

State preservation and restoration strategies with Core Data objects in a UIManagedDocument

I'm starting to try and add support for state preservation and restoration to my iOS app, which has a Core Data component to it that I access via a UIManagedDocument. I'm starting to add the restoration identifiers to my view controllers, and have…
3
votes
1 answer

How to override the NSPersistentStoreCoordinator in UIManagedDocument

I have an application that uses Core Data through UIManagedObjectDocument. I am trying to add encryption to the underlying SQLite database by using Encrypted Core Data (https://github.com/project-imas/encrypted-core-data). From the description for…
Ian
  • 841
  • 5
  • 10
3
votes
0 answers

overriding UIManagedDocument -savingFileType

I'm trying to override UIManagedDocument's -savingFileType so that my app's files can be of a type other than a folder. -(NSString*)savingFileType{ return @"com.myCo.myApp"; } - (NSString *)fileNameExtensionForType:(NSString *)typeName…
olynoise
  • 2,016
  • 2
  • 19
  • 32
3
votes
2 answers

Could not create UIManagedDocument

I'm trying to make an iPhone app using Core Data. I have to use NSManagedObjectContext to access data and in order to do this i use UIManagedDocument. But if I try to create a document with UIManagedDocument, document's openWithCompletionHandler…
3
votes
3 answers

Is it possible to intercept iCloud switching on/off in Settings -> iCloud -> Document & Data?

Is it possible to intercept if the user switches from on to off the iCloud support under Settings -> iCloud -> Document & Data? Obviously when he does this the app has already resigned active and entered the background. I am targeting iOS7 and I…
nico9T
  • 2,496
  • 2
  • 26
  • 44
3
votes
1 answer

Set a lastModificationDate attribute after NSManagedObjectsDidChangeNotification creates an infinite loop

I added a lastModifiedDate attribute to all my entities to avoid duplicates when syncing the UIManagedDocument with iCloud, something that I found it can happen if I create new entities with an offline device (iPad) and, at the same time, I create…
nico9T
  • 2,496
  • 2
  • 26
  • 44
3
votes
2 answers

Disable auto-saving in UIManagedDocument

Is there any way to disable auto-save for UIManagedDocument ? I present NSManagedObjects in a controller where the user can add and delete them. But I just want to save those changes when the user explicitly fires a save action. Otherwise I want to…
kahlo
  • 2,314
  • 3
  • 28
  • 37
3
votes
2 answers

Are NSPersistentDocument and UIManagedDocument compatible?

I would like to create a NSPersistentDocument in Mac OS X and read this document as a UIManagedDocument on iOS 7. Is this possible? Are both file formats compatible? Thank you!
AlexR
  • 5,514
  • 9
  • 75
  • 130
3
votes
1 answer

Any Special Considerations when using multiple UIManagedDocuments in iOS

I've been using a UIManagedDocument inside of a Singleton class. I create, open and perform with etc and everything was going fine until I needed to have two separate Data stores with an identical Schema. I've made sure everything was done in the…
SeanCAtkinson
  • 753
  • 1
  • 4
  • 15
3
votes
1 answer

Cannot open UIManagedDocument file seems to be corrupted after a few opens

I'm trying to open a UIManagedDocument after creating it. It seems to be unable to open the document after a few times of successfully opening the document. If I change the document name or delete/copy the app again, it works. The below method is…
Venkat S. Rao
  • 1,110
  • 3
  • 13
  • 29
3
votes
1 answer

Auto-save not working with NSUndoManager on UIManagedDocument

Resolution NSUndoManager must only be used in a child NSManagedObjectContext (when used with Core Data). This is because the UIManagedDocument may auto-save at any point in time, after which an undo will have no effect. Therefore there is no point…
Michael
  • 8,891
  • 3
  • 29
  • 42
1 2
3
12 13