0

I am trying to store a JSON into Coredata using Mantle and I have the following code:

        PPCoreDataStack *coreDataStack = [PPCoreDataStack defaultStack]; //my custom wrapper for CoreData a simple accessor really

        NSManagedObject *mob = [MTLManagedObjectAdapter managedObjectFromModel:userModel insertingIntoContext:coreDataStack.managedObjectContext error:&error];

        if(mob) {
            NSLog(@"Mob: %@", mob);
        } else {
            NSLog(@"Mob Error: %@", [error localizedDescription]);
        }

        [coreDataStack saveContext];

I am getting the following error:

        Mob Error: Could not serialize managed object

I am not sure why. I am new to core data so please help me understand what could be going wrong here.

David Snabel-Caunt
  • 57,804
  • 13
  • 114
  • 132
Obaid
  • 4,328
  • 9
  • 42
  • 42

1 Answers1

0

Ok so this was just stupid. The entity was not in the model.

Obaid
  • 4,328
  • 9
  • 42
  • 42