I am currently working on a project where I am saving to my main context from a background Thread. Like so:
DispatchQueue.global().async {
...
context.save()
}
I have now read that this is not okey, since every thread has it's own context?
My question is that I had this code for a long time now and it worked nearly perfectly (no errors!). Just now I am noticing some weird behaviors which is why I came to researching it.
Does anyone know why? Maybe also what I should do instead? I have a huge calculation that I don't want to do on the main-thread. (which is needed for the object I want to save to core-data)
Thank you:-)