magicalpanda/MagicalRecord — pull request #425 by twobitlabs (2013-02-26 18:52:06+00:00)
Title: When saving a context, execute the completion block on the calling thread

MR_saveWithOptions:completion: currently dispatches the completion block to execute asynchronously on the main thread. This has 2 negative effects:

1) Because it's asynchronous, it prevents the caller from handling errors appropriately in the callback. If there's an error on save, the caller should have the flexibility to bail or reset the context.

2) Because it's executed on the main thread, a caller on a background thread cannot include code in the callback that must also be executed on the background thread.

It's trivial for the caller to include a dispatch_async(dispatch_get_main_queue(), ^{}) inside their completion block if that's the desired behavior, but the API shouldn't make that assumption for them.