iPhone开发 - CoreData运行时错误 [英] iPhone Development - CoreData runtime error

查看:151
本文介绍了iPhone开发 - CoreData运行时错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我面临着一个奇怪的CoreData问题。这是日志:

I'm facing a strange CoreData issue. Here's the log:

2010-04-07 15:59:36.913 MyProject[263:207] <MyEntity: 0x180370> (entity: MyEntity; id: 0x17e890 <x-coredata://0F55C533-41BD-4F09-9CCA-0CB304CAB065/MyEntity/p380> ; data: <fault>)
2010-04-07 15:59:36.918 MyProject[263:207] *** Terminating app due to uncaught exception 'NSObjectInaccessibleException', reason: 'The NSManagedObject with ID:0x17e890 <x-coredata://0F55C533-41BD-4F09-9CCA-0CB304CAB065/MyEntity/p380> has been invalidated.'

我有一个UITableViewControllers的层次结构,使用NSFetchedResultsController填充表,选择特定行,则显示详细视图。

I have a hierarchy of UITableViewControllers that use NSFetchedResultsController to populate the table, and when a particular row is selected, the detail view is shown.

UITableView (MyMainEntity)
UITableView (MyEntity)
UITableView (MyEntity) detail view

MyMainEntity UITableView和MyEntity UITableView使用NSFetchedResultsController显示记录。有时它崩溃,当我滚动tableView,有时它崩溃,当我试图打开细节视图。在应用程序崩溃之前,我可以导航到MyEntity详细信息视图多次。

Both MyMainEntity UITableView and MyEntity UITableView use NSFetchedResultsController to show the records. Sometimes it crashes when i'm scrolling the tableView, and sometimes it crashes when i try to open the detail view. I can navigate to the MyEntity detail view multiple times before application crashes.

此错误是什么意思?

推荐答案

如果对象已经失效,通常意味着底层的托管对象模型已经被释放。您需要确保保留包含您正在处理的对象的托管对象模型。

If the object has been invalidated it usually means the underlying managed object model has been released. You need to make sure you retain the managed object model that contains the objects you are dealing with.

有关详细信息,请参阅此页面:

See this page for more details:

http ://www.devworld.apple.com/mac/library/documentation/Cocoa/Conceptual/CoreData/Articles/cdTroubleshooting.html

它也可以意味着MOC已被重置,或底层存储文件现已消失。

It could also mean the MOC has been reset, or the underlying store file is now gone.

这篇关于iPhone开发 - CoreData运行时错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆