Skip to content

Missing methods in NSManagedObjectContext+MagicalRecord.h #482

TiagoVeloso opened this Issue May 18, 2013 · 7 comments

4 participants


[NSManagedObjectContext MR_setDefaultContext:myNewContext];
[NSManagedObjectContext MR_setRootSavingContext:myNewContext];

Are not public in NSManagedObjectContext+MagicalRecord.

Should they not be as they are presented in example usage?

Magical Panda Software member

Maybe I don't need them. But I am trying to integrate MagicalRecord with RestKit (I reckon that there isn't any official support for RestKit).

I have found some sample code here:
More precisely here:

Where those methods are used to accomplish what I want.

Also, at least one of these methods is referenced in MagicalRecord's documentation, here:

I am just wondering if they being private is some kind of mixup.

Also if you could point me to how I can achieve MagicalRecord + RestKit integration without using these methods I would appreciate it.

Magical Panda Software member

Ah, ok. I'll try that. I saw them used in the example and I figured I should used them as well. I try it out.

Thanks. And if the methods are truly meant to be private feel free to close this issue. Just take a look at MagicalRecord's documentation to remove that reference to setDefaultContext.


I can confirm, removing those two sets from the setup allowed MagicalRecord to continue to work as expected.



I am running into a related issue. I'm working on an existing project where they are setting up the Core Data stack in a "traditional" (Apple) way. When trying to use any of the MagicalRecord functionality on an NSManagedObject, the app halts in NSManagedObjectContext+MagicalRecord.m when the MR_defaultContext is accessed because it is, in fact, nil since the MagicalRecord stack setup is never used.

With no out-of-the-box way to set any of MagicalRecord's contexts to the one created traditionally, I'm not sure of the best way to resolve this. I looked at the RestKit approach from above (we evaluated RK this past summer and felt it was too heavy) and agree with previous posts that this is not the way to go.

Sorry if I'm missing something blatantly obvious, but it's got me stumped. :)


Given the age of this issue, and the volume of issues we have to work through, I've decided to close this alongside a number of other older issues.

If you can still replicate the issue under the latest in-development version of MagicalRecord (3.0 at the time of writing), please feel free to re-open and one of @magicalpanda/team-magicalrecord will take another look. Thanks!

@tonyarnold tonyarnold closed this Apr 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.