更改核心数据中托管对象模型的属性值时崩溃
我有一个表视图控制器,它使用每行的获取结果控制器来获取项目。当选择一行时,它会推送一个新的视图控制器来编辑该特定的托管对象模型 - 当我编辑并尝试保存时,我会得到以下内容。原因是什么? 谢谢
Serious application error. Exception was caught during Core Data change processing. This is usually a bug within an observer of NSManagedObjectContextObjectsDidChangeNotification. Can't use in/contains operator with collection 0 (not a collection) with userInfo (null)
Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
_Unwind_Resume called from function -[NSManagedObjectContext(_NSInternalChangeProcessing) _processRecentChanges:] in image CoreData
。
I have a table view controller which fetches items using fetched results controller for each row. When a row is selected it pushes a new view controller to edit that particular managed object model - when I edit and try to save I get the following. What is the cause?
Thanks
Serious application error. Exception was caught during Core Data change processing. This is usually a bug within an observer of NSManagedObjectContextObjectsDidChangeNotification. Can't use in/contains operator with collection 0 (not a collection) with userInfo (null)
Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
_Unwind_Resume called from function -[NSManagedObjectContext(_NSInternalChangeProcessing) _processRecentChanges:] in image CoreData
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
错误的这一部分:
通常表示错误的谓词,最有可能是在 fetch 或 fetched 属性上。您很可能尝试在谓词中使用
IN
或CONTAINS
运算符,而不提供目标对象属性可能所在的实际值集合。例如... vs:
据推测,您在编辑中更改的内容会破坏表获取中的谓词。您还需要确保已实现获取结果控制器的委托方法,以便在插入、删除或更改对象时,表将正确更新以反映这些更改。
(错误的其余部分无关紧要。这只是一个框架警告,您无能为力。)
This part of the error:
usually indicates a bad predicate, most likely on a fetch or fetched attribute. You've mostly likely tried to use the
IN
orCONTAINS
operator in a predicate without supply an actual collection of values that the targeted objects attributes could be in. E.g...vs:
Presumably, something you are changing in your edit is breaking your predicate in the table's fetch. You also want to make sure you've implemented the fetched results controller's delegate methods so that if an object is inserted, deleted or changed, the table will be properly updated to reflect those changes.
(The rest of the error is irrelevant. It's just a framework warning you can't do anything about.)