0

我得到了一小部分代码:

nwtAppDelegate *appDelegate =(nwtAppDelegate *) [[UIApplication sharedApplication] delegate];

NSManagedObjectContext *context =
[appDelegate managedObjectContext];
NSManagedObject *newContact;
newContact = [NSEntityDescription
              insertNewObjectForEntityForName:@"EN"
              inManagedObjectContext:context];
[newContact setValue:@"laaa" forKey:@"b_1_1"];
NSError *error;
[context save:&error];

但我收到此错误+entityForName: could not locate an entity named 'Entityname'

实体和属性确实存在。

图表:

在此处输入图像描述

4

0 回答 0