ios - Core data - DENY rule is not deleting destination objects related to the source object deleted -
I have two tables There are many connections between assignment and question both tables. The rule is to remove the rules from the assignments DENY and cancel the assignments with the questions.
When an assignment is removed, I would like to exclude all the questions related to that assignment, those who leave the questions which are still in reference, the other assignment is that Dennis is removed from the rule assignment Questions have been set on.
Before deleting the assignment, I am sure that according to the tasks given below, I will remove the questions from context:
assignment * assignment = removal of assignment; (In the questionnaire * question [assignment questions all object]) {// NSLog (@ "question id% @", question, question iid); // [Remove QuestionSignment Object: Assignment]; [Remove assignment question: object]; //question.assignments = Zero; } [[[CoreDatManager Shared Object] Managed Object Contract] DeliAbject: Assignment]; [[Coreadata Manager Shared Object] Managed Object Contex] Save: & amp; Error]; But after deleting the assignment, none of the queries in the database are being removed. Is there anything that I am doing wrong?
Denny rules are not the reason for the removal of an object. This prevents the source object from being removed from the relationship only with the relationship to the destination object.
In this case (DENY rules for the assignment question), if any question is related.
Your code only removes relationships related to the assignment question. You have to check that the rest of the question remains the rest, and otherwise delete the question.
Also keep in mind that questions.seignments = zero; Assignment from the deletes everyone question in your loop, not just an "removal of assignment".
Comments
Post a Comment