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

UIManagedDocument openWithCompletionHandler returns NO

So I was migrating my Core Data to UIManagedDocument. Calling openWithCompletionHandler on iPhone simulator works fine, but when I try to run my project on a real device it always returns NO. I override handleError and that's what I get: Error…
Alex Fi
  • 45
  • 2
  • 6
2
votes
1 answer

Strategy to launch a task - and avoid race conditions - from the App Delegate

I'm developing a small app on top of core data. At startup, I need to launch a maintenance task - fast but important -. To run this task, the app delegate must open a UIManagedDocument, and perform various checks on it. The app views must not start…
Alex
  • 1,581
  • 1
  • 11
  • 27
2
votes
0 answers

UIManagedDocument fileModificationDate doesn't change

Opening, closing, changing data and saving the document using the proper UIDocument Saving API methods will not change the value returned from the fileModificationDate property. From the docs: The modification date is updated by the…
2
votes
1 answer

Fetching data from database (CoreData)

I have two questions: 1- Do i need to have the same UImanagedDocument to enter entities and fetch them, or is it possible to enter and read the data from different objects? 2- Is there any way to confirm that data has been entered to the database?…
YYfim
  • 1,402
  • 1
  • 9
  • 24
2
votes
1 answer

iCloud NSPersistentStoreDidImportUbiquitousContentChangesNotification only called right after app launch

My app uses a core data database contained inside of a UIManagedDocument. When I am attempting to sync over iCloud, the data rarely gets refreshed. I have turned on the ubiquity logs by adding the following app argument to my…
mrosales
  • 1,543
  • 11
  • 18
2
votes
0 answers

UIManagedDocument CompletionHandler not executed in iOS 5.1 simulator but works on device and iOS 6.0 simulator

I hope someone has some thoughts on this one... I have a project that uses UIManagedDocument. The first thing I do in the appDelegate is open the document. Everything has been going fine until suddenly (nothing was changed in the code) the…
Scott Sarnikowski
  • 1,461
  • 2
  • 14
  • 24
2
votes
0 answers

I get an EXC_BAD_ACCESS when creating UIManagedDocument

I am creating UIManagedDocument and I don't know why I get the error saying: Thread 1: EXC_BAD_ACCES code=1 address=0xdeadbeef The only thing in my code is the creation of this UIManagedDocument. This function is called in viewDidLoad: -…
Martin Verdejo
  • 1,229
  • 2
  • 13
  • 24
2
votes
1 answer

Big trouble after app update. CoreData migration error

this morning we had a big trouble with our iphone app. We had to even take it off the store. The thing is that we made real small changes to our xcdatamodel. We thought that the update process is automatically taking care about exchanging it the…
MrBr
  • 1,884
  • 2
  • 24
  • 38
2
votes
0 answers

TabBar application with multiple NSFetchedResultsController but only one UIManagedDocument

I'm having some problems with the Core Data stuff, when used via a Managed Document. I have a multiple tab application, and each tab must show different entities of a single database. In order to initialize the Managed Document, I've created a…
2
votes
1 answer

How to open/create UIManagedDocument synchronously?

As mentioned in title, I would like to open UIManagedDocument synchronously, i.e, I would like my execution to wait till open completes. I'm opening document on mainThread only. Current API to open uses block [UIManagedDocument…
Hitesh Savaliya
  • 1,336
  • 13
  • 15
2
votes
1 answer

NSFetchedResultsController fails to fetch in child context

I have a UIManagedDocument with some data which I display in a list using NSFetchedResultsController. The data is regularly updated in the background and changes are put onto the UIManagedDocument.managedObjectContext (using performBlock:). When I…
Alfonso
  • 8,386
  • 1
  • 43
  • 63
2
votes
2 answers

UIManagedDocument - How to deal with UIDocumentStateSavingError?

I am working on my first iCloud App. After working for a while the app cannot access a UIManagedDocument any more due to an "UIDocumentStateSavingError". Is there any way to actually find out what error occurred? This is my code to create the…
Andrei Herford
  • 17,570
  • 19
  • 91
  • 225
1
vote
5 answers

NSFileCoordinator error when using UIManagedDocument in iOS 5.0 simulator

I am using a UIManagedDocument in iOS 5.0, running the app on the simulator, using XCode 4.2 under OSX 10.6. The code in question looks as follows: if (![[NSFileManager defaultManager] fileExistsAtPath:[self.photoDatabase.fileURL path]]) { //…
1
vote
0 answers

Entity Update error: after it has been removed from its context

Good morning, After updating to IOS11 in order to give support to iPhoneX our app has stopped working with iCloud correctly. The thing is that CoreData is working alright in Local Store, however when we try to use an iCloud document we stop being…
Kasas
  • 1,216
  • 2
  • 18
  • 28
1
vote
0 answers

Switching between multiple object graphs in CoreData

I’m using CoreData in an iOS app as my relational database. The relationships between the entities are a little complicated, but only a small number of objects (<40) are created. I’d like the user to build up the object graph, be able to save the…
c_booth
  • 2,185
  • 1
  • 13
  • 22