使用Objective C加入coredata [英] joins in coredata using Objective C
问题描述
如何在核心数据中进行内部联接,外部联接(左,右,完整)。
我已经使用基于sqlite c的API在sqlite db中轻松地做到了,但是我找不到在Objective C中如何使用核心数据来实现它的任何资源。
基本上,我需要查询涉及三个以上表或对象之间的关系的CoreData。
注意:
如何在核心数据中设置表之间的关系将很有帮助。
,例如主键-外键关系,级联关系。
要查询您需要为此创建NSPredicates的核心数据,并且其在文档中已明确说明您不能将任何查询转换为NSPredicates。
有关更多信息,请阅读:-
How to make inner joins,outer joins(left,right,full) in core-data. I have done it easily in sqlite db using sqlite c based APIs But I couldn't find any resources on how to do it using core-data in Objective C.
Basically I have a need to query CoreData that involves relation between more than three tables or objects.
Note:
How to set relationship between tables in core-data would be helpful. such as Primary key - foreign key relationship,cascade relationship.
To query Core Data you need to create NSPredicates for that and its clearly stated in documentation that you cannot convert any arbitrary query into NSPredicates.
For more info read this :-https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Predicates/Articles/pUsing.html
这篇关于使用Objective C加入coredata的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!