表视图核心数据中的 NSException
我正在开发一个应用程序,显示来自 coredata 数据库的基本信息, 当我点击保存按钮时,我有数据库保存信息, 但是当我想在表的另一个视图中显示数据时, 我没有收到任何错误,但出现 NSexeption>
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '+entityForName: could not locate an NSManagedObjectModel for entity name 'Contacts''
我在sqlite图形界面中检查数据保存正确,但没有显示在表中,出现上述错误,
请问如何修复?
我的小项目是在 这里!
非常感谢!
Im developing an app that shows basic info from a coredata db,
I have the db saving info when hit save button,
but when I want to show the data in another view in a table,
I get no errors, but an NSexeption>
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '+entityForName: could not locate an NSManagedObjectModel for entity name 'Contacts''
the data is saving correctly as I checked it in a sqlite graphical interface, but not showing in the table, with the above error,
how to fix it please?
my little project is in
here!
thank you so much!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,您的
managedObjectContext
需要来自 App Deleagte,在ShowViewController
中尝试:现在,上下文来自 _context,它是 NULL。
Okay, your
managedObjectContext
needs to come from the App Deleagte, inShowViewController
try:Right now, the context is coming form _context, which is NULL.