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

deprecated method alternative #986

Open
syrakozz opened this issue Mar 19, 2015 · 6 comments
Open

deprecated method alternative #986

syrakozz opened this issue Mar 19, 2015 · 6 comments
Assignees
Labels

Comments

@syrakozz
Copy link

MR_contextForCurrentThread
MR_saveWithErrorCallback
MR_resetContextForCurrentThread

@tonyarnold
Copy link
Contributor

Please have a read of Why contextForCurrentThread Doesn't Work in MagicalRecord.

@tonyarnold tonyarnold self-assigned this Mar 20, 2015
@syrakozz
Copy link
Author

but in my case i use it like this

return [NSEntityDescription insertNewObjectForEntityForName:entityName inManagedObjectContext:[NSManagedObjectContext MR_contextForCurrentThread]];

is there any alternative for it

@syrakozz
Copy link
Author

syrakozz commented May 6, 2015

@tonyarnold thank you,
what do you suggest so i can Get rid of calling this method

 [NSManagedObjectContext MR_contextForCurrentThread] 

how i can replace it with what ,
thank you

@tonyarnold
Copy link
Contributor

There is no alternative to this method, as what it was doing had the potential to cause big problems.

You should re-architect your application in such a way that you create child contexts as you need to use them.

There is some information available in the wiki on Working with Managed Object Contexts.

@syrakozz
Copy link
Author

syrakozz commented May 7, 2015

great, thank you , can i use
MR_defaultContext instead of it in some cases
[NSManagedObjectContext MR_defaultContext]

@Alydyn
Copy link

Alydyn commented May 7, 2015

As long as you are on the main queue.

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

No branches or pull requests

3 participants