Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Some time has passed and hopefully you've already resolved your issues here, but just in case as I've been fighting through a pile of UIManagedDocument related issues myself over the past couple months so I feel your pain. What you're doing here is fairly similar to what I needed to do in a recent project.</p> <p>Unfortunately the documentation and various suggestions floating around online on how to save (or not save) a UIManagedDocument in general seems to be somewhat all over the place. I've found similar results using both the saveToURL and updateChangeCount approaches, however the updateChangeCount approach seems to less frequently result in save errors. But I don't think that is really impacting your issue.</p> <p>As long as you only have one thread accessing your document and as long as you only have one document open for your data, you shouldn't actually need to save, it will automatically save within that context. Saving is needed to push changes out from that context to the other context (UIManagedDocument has two) and eventually out to the cloud and other devices. You have two layers of performBlock within your completionHandler which may be complicating things and leading to cases where more then one thread could be accessing your database at the same time possibly in an unpredictable order. When I do all of my preloading and setting it's all just sequentially within the completionHandler followed by the equivalent of your opendatabaseAndUseBlock and it never crashes.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload