Skip to content

*** Assertion failure in +[NSManagedObjectContext MR_defaultContext] when trying to truncate #524

Closed
mal3k opened this Issue Jul 29, 2013 · 2 comments

2 participants

@mal3k
mal3k commented Jul 29, 2013

I am getting an exception with MagicalRecord version 2.0.7

whenever I launch the app, it crashes with this exception:
*** Assertion failure in +[NSManagedObjectContext MR_defaultContext]

I ma configuring coredata like this:
In appdelegate didFinishLaunchingWithOptions method:
[MagicalRecord setupCoreDataStack];
In appdelegate applicationWillTerminate:
[MagicalRecord cleanUp];

I noticed the crash is caused by this statement where I try to remove all records on an entity:

NSManagedObjectContext *localContext = [NSManagedObjectContext MR_contextForCurrentThread];

[Song MR_truncateAllInContext:localContext];

Am I missing something? Thanx

@tonyarnold

@mal3k, can you try this with a more recent release of Magical Record? 2.2 is the current release at the time of this reply.

Also, are you saving the changes to the context, or just working with them in memory?

@tonyarnold

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.