Open killerham opened 9 years ago
This is more of a stack overflow question than github. The MR team would like github to be used for actual code issues and stack overflow to be used for support.
That being said, it's pretty tough to answer that question without a lot more info. However, in general, you would probably have better luck using NSOperation
's and an NSOperationQueue
, and utilize completion blocks and/or operation dependencies.
@killerham if you create a SO question please provide the link as I'm interested in possible answers for this question. Thanks
Hello,
What is the best way for me to sync the background saving threads that are created from the [MagicalRecord saveWithBlock:^] functions with the main thread?
The reason I need to do this is because I want to wait until all of the saves are guaranteed to be completed before closing the document. This is to prevent long background saves from occurring while the document is closed.
I've tried calling [MagicalRecord saveWithBlockAndWait:^] when exiting the document, but it seems to not be waiting for the entire background queue to complete.
Thanks