我有一个核心数据存储设置与Xcode生成的NSManagedObject的子类:注意.
我可以使用NSEntityDescription insertNewObjectForEntityName:inManagedObjectContext:没有问题,但是当我尝试这样做时:
NSManagedObjectContext* moc = [(QuickTextAppDelegate*)([[UIApplication sharedApplication] delegate]) managedObjectContext];
Note* note = [[Note alloc] initWithEntity:@"Note" insertIntoManagedObjectContext:moc];
Run Code Online (Sandbox Code Playgroud)
我收到一个EXC_BAD_ACCESS错误.
使用断点我可以看到NSManagedObjectContext*确实指向了一个有效的对象.
任何帮助,将不胜感激!