I'm new to using CoreData and MagicalRecord. I have this in my AppDelegate
and not sure why there's an issue.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[MagicalRecord setupCoreDataStack];
NSManagedObjectContext *context = [NSManagedObjectContext MR_defaultContext];
NSEntityDescription *desc = [NSEntityDescription entityForName:@"GFSetModel" inManagedObjectContext:context];
GFSetModel *test = [GFSetModel MR_createEntityInContext:context];
return YES;
}
desc
is always nil for some reason and since MR_createEntityInContext
calls entityForName: inManagedObjectContext:context
, it makes the test object nil as well. I tried different default contexts. What am I doing wrong?
Ahh, I didn't make a
.xcdatamodeld
and that was the reason.