Open engmsaleh opened 8 years ago
You should have a read of @casademora's article Why contextForCurrentThread Doesn't Work in MagicalRecord for an explanation of what I think is happening here.
Also, I see that all methods that don't specify a
context
is deprecated if so , Could you advise about the correct way of doing such manipulation?
You need to use the method that requires you to specify a context, and create one using [NSManagedObjectContext MR_context]
(or use one you already have on hand, but be aware of Core Data's threading rules).
I have a method where I need to do two consecutive
MR_find
and I'm usingMR 2.3
. Currently I'm using the CoreData concurrency debug and I always get a concurrency problem with the secondMR_find
Here is the method under investigation:I think it is maybe due to accessing data from multiple contexts , but I'm not sure. As I dig through
MR_find
and as I can see that they are using the current thread and as I understand it isMainContext
, Please tell me if I'm wrong? Also, I see that all methods that don't specify acontext
is deprecated if so , Could you advise about the correct way of doing such manipulation?