Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difference between MR_Save and MR_saveNestedContexts #305

Closed
jmca opened this issue Nov 9, 2012 · 3 comments
Closed

Difference between MR_Save and MR_saveNestedContexts #305

jmca opened this issue Nov 9, 2012 · 3 comments

Comments

@jmca
Copy link

jmca commented Nov 9, 2012

This is a question and not an issue. I'm trying to understand the difference between MR_save and MR_saveNestedContexts. Looking at the names, I would assume MR_save is equivalent to NSManagedObjectContext's save: method, and MR_saveNestedContexts saves all children contexts up to the root which then persists to the store. But looking at the source, it looks like both methods are doing the same recursion up to the root, and therefore persisting to store.

So the questions is if I only want to save a child context up one level (not to the root context), should I use save: or MR_save?

@matej
Copy link

matej commented Nov 12, 2012

In the latest version MR_save just calls MR_saveWithErrorCallback:, which will just save the current context, without any recursion. So the answer to your question would be that you can use eater of those two, although MR_save is a bit more convenient and powerful.

@jmca
Copy link
Author

jmca commented Nov 12, 2012

Perfect, thanks. I was using version 2.0.7, and just looked at the commit where MR_save was changed.

@blackgold9
Copy link
Contributor

Exactly right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants