0

我正在开发一个显示来自 coredata db 的基本信息的应用程序,当我点击保存按钮时我有 db 保存信息,但是当我想在表的另一个视图中显示数据时,我没有收到任何错误,但是 NSexeption>

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason:    '+entityForName: could not locate an NSManagedObjectModel for entity name 'Contacts''

当我在 sqlite 图形界面中检查数据时,数据已正确保存,但未显示在表格中,出现上述错误,

请问如何解决?

我的小项目在 这里!

太感谢了!

4

1 回答 1

0

好的,您managedObjectContext需要来自 App Deleagte,ShowViewController尝试:

    managedObjectContext = [(CoreDataEnsaAppDelegate *)[[UIApplication sharedApplication] delegate] managedObjectContext];

现在,上下文来自 _context,它是 NULL。

于 2010-12-20T07:36:59.767 回答