I am using XMPP Framework's Core Data message storage and I want to add to my app another Core Data Entity, I create .xcdatamodeld and create Entity, I add code to my AppDelegate, but I get error. Can it be because I use XMPP Framework's Core Data message storage and how to fix it?
NSManagedObjectContext *context = [self managedObjectContext_messageList];
NSManagedObject *contexNew = [NSEntityDescription insertNewObjectForEntityForName:@"UserProfileEntity" inManagedObjectContext:context];
[contexNew setValue:@1 forKey:@"id"];
[contexNew setValue:@"name TEST" forKey:@"name"];
[contexNew setValue:@"test YEP" forKey:@"test"];
NSError *error;
if ([context save:&error])
{
NSLog(@"%@", error.description);
}
It crashes on on second line with
'+entityForName: nil is not a legal NSManagedObjectContext parameter searching for entity name 'UserProfileEntity''