magicalpanda / MagicalRecord

Super Awesome Easy Fetching for Core Data!
Other
10.8k stars 1.79k forks source link

setupCoreDataStack crash with -com.apple.CoreData.ConcurrencyDebug 1 #935

Open duttski opened 9 years ago

duttski commented 9 years ago

I set up an empty project using the single view application with core data enabled in Xcode Version 6.1.1 (6A2008a).

I installed MagicalRecord via CocoaPods -- v2.2 came by default.

I add the following in AppDelegate: #import <CoreData+MagicalRecord.h> ...

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [MagicalRecord setupCoreDataStack];
    return YES;
}

I then enabled -com.apple.CoreData.ConcurrencyDebug 1 and ran the project in the sumulator with otherwise default settings.

2014-12-28 14:59:07.670 TestCdd[93217:2459524] CoreData: annotation: Core Data multi-threading assertions enabled. ... And a crash in NSManagedObjectContext+MagicalRecord.m at line:

- (NSString *) MR_workingName;
{
    NSString *workingName = [[self userInfo] objectForKey:kMagicalRecordNSManagedObjectContextWorkingName];

With -com.apple.CoreData.ConcurrencyDebug disabled, I get the following log output. And in my real app everything works as expected:

2014-12-28 15:15:07.983 TestCdd[93351:2466091] +[NSManagedObjectContext(MagicalRecord) MR_contextWithStoreCoordinator:](0x102097400) -> Created Context UNNAMED
2014-12-28 15:15:07.986 TestCdd[93351:2466091] +[NSManagedObjectContext(MagicalRecord) MR_setRootSavingContext:](0x102097400) Set Root Saving Context: <NSManagedObjectContext: 0x7ffe92f5e2a0>
2014-12-28 15:15:07.986 TestCdd[93351:2466091] +[NSManagedObjectContext(MagicalRecord) MR_newMainQueueContext](0x102097400) Created Main Queue Context: <NSManagedObjectContext: 0x7ffe92eae180>
2014-12-28 15:15:07.987 TestCdd[93351:2466091] +[NSManagedObjectContext(MagicalRecord) MR_setDefaultContext:](0x102097400) Set Default Context: <NSManagedObjectContext: 0x7ffe92eae180>

I've tried to reduce this down as far as possible, and maybe it's a bug with the simulator, but all the same it seems a little odd.

Apologies if this is not a bug in MR.

jnordh commented 9 years ago

Hello, I am getting the same crash! Same setup as above. What is wrong? Please help! Thanks! regards -Jan

Alydyn commented 9 years ago

You should try using version 2.3beta5, found in the Release section. https://github.com/magicalpanda/MagicalRecord/tree/v2.3.0-beta.5

duttski commented 9 years ago

Thanks that did start successfully this time.