开发者

CoreData: inverse relationship no set automatically

开发者 https://www.devze.com 2023-02-20 07:11 出处:网络
I\'ve got a very strange situation: in one app I have lots of CoreData entities. Few pairs of them are connected by one-to-one relationships with inver开发者_C百科se relationships. They are kind of pa

I've got a very strange situation: in one app I have lots of CoreData entities. Few pairs of them are connected by one-to-one relationships with inver开发者_C百科se relationships. They are kind of parent-to-child relationships: so when parent is created I create child in it's awakeFromInsert. The problem is that in one of such relationships inverse parent.child is nil. And of course I've got error when trying to save managedObjectContext. Of course I can set this inverse relationship manually, but I wonder why it's not set automatically?

0

精彩评论

暂无评论...
验证码 换一张
取 消