简体   繁体   English

从核心数据删除对象

[英]Delete objects form Core Data

I implemented core data in my app with 2 Entity named "Employees" & "Departments". 我在我的应用程序中使用2个名为“雇员”和“部门”的实体实现了核心数据。

They have a relationship with many to many . 他们与许多人有关系。 But no action for deletion now on relationship. 但是现在没有删除关系的操作。

Now, I need like if any department has no employee then that department will automatically delete from DB. 现在,我需要某个部门没有员工,那么该部门将自动从数据库中删除。

Is this possible? 这可能吗?

Thanks for your time :) 谢谢你的时间 :)

如果我们在提取您需要使用与您的要求匹配的谓词来过滤数据时遇到麻烦,则无法自动删除。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM