Core Data - Why isn't inverse relationship set automatically?

孤人 提交于 2019-12-11 11:35:57

问题


I have a a one-to-many relationship as an NSOrderedSet on an NSManagedObject.

When the addObject: method is called on the ordered set (which I'm calling from a property on an NSManagedObjectModel subclass object), however, the inverse relationship is not being set automatically. What can cause this?

As a related note, I am using Magical Record to make it easier to map data to the NSManagedObject objects.

Further, I've also referred to this post, but I'm not overriding these methods on my subclass:

Core Data Inverse Relationship Not Being Set


回答1:


NSOrderedSet has serious bugs in Core Data. See this post on ways to get around them for the time being:

Exception thrown in NSOrderedSet generated accessors



来源:https://stackoverflow.com/questions/12430632/core-data-why-isnt-inverse-relationship-set-automatically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!