In my iOS 7+ app I'm using Core Data with a single shared UIManagedDocument. I know that this approach is not recommended anymore and that one should use standard Core Data stack, but I would love to know what is happening in this case.
As I said, I'm using single shared UImanagedDocument, implemented like described in this blog post. Quite randomly, after many "concurrent" writing and reading on UIManagedDocument instance I get following error in UIDocument overriden method - (void)handleError:userInteractionPermitted::
Error Domain=NSCocoaErrorDomain Code=134030 "The operation couldn’t be completed.
(Cocoa error 134030.)" UserInfo=0x14ea16e0 {NSAffectedStoresErrorKey=(
"<NSSQLCore: 0x14d9a0b0> (URL: file:///var/mobile/Applications/8C70F46C-74DB-427B-8DE2-68A36B326CA7/Library/CoreDataDatabase/StoreContent/persistentStore)"), NSUnderlyingError=0x14e8ca10 "The operation couldn’t be completed. (Cocoa error 4.)\"
UserInfo=0x14e1b7d0 {NSUnderlyingError=0x14eb3d90 \"The operation couldn\U2019t be completed. No such file or directory\"}"
Through the app I'm saving my document with [document saveToURL:document.fileURL forSaveOperation:UIDocumentSaveForOverwriting completionHandler:NULL];.
Error is emerged after the document switches to UIDocumentStateSavingError state.
I've tried re-opening my document after that but it didn't work. Looks like the persistent store is being deleted (at least that is what an error is suggesting) but I don't have a single clue why.
Thanks in advance!