I have a problem with my core data. I am trying to save the context and I keep getting this error:
'NSInternalInconsistencyException', reason: 'This NSPersistentStoreCoordinator has no persistent stores. It cannot perform a save operation.'
This is my code where I make the core data things:
managedObjectModel_ = [NSManagedObjectModel mergedModelFromBundles:[NSArray arrayWithObject:[NSBundle mainBundle]]];
persistentStoreCoordinator_ = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:managedObjectModel_];
managedObjectContext_ = [[NSManagedObjectContext alloc] init];
[managedObjectContext_ setPersistentStoreCoordinator:persistentStoreCoordinator_];
I really have no idea what’s going on.
BTW, I am developing for iOS if it makes a difference.
Thanks.
You need to add persistent store to coordinator. Something like this: