CoreData get parent of child

我的未来我决定 提交于 2019-12-20 07:28:29

问题


I have a one-to-many relationship store <---->> product, and I know the product, how can I find out who the parent of this product is? I can have many products with the same values, for example product1 has parent1 and another product with the same values as product1 has parent2 so i cant't search which parent contains product1?


回答1:


You should have noticed the core data model editor bugging you about the relationship not having an inverse relationship if you don't have one. If you do have one, it's as simple as using that key.

Hypothetically, store has a relationship products - so each product should have a relationship store.



来源:https://stackoverflow.com/questions/23923673/coredata-get-parent-of-child

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