cocoa - How to properly cascade delete managed objects in Core Data? -


I have a core data model that has three entities: A, B, and C. In connection with one-to-many B, there are many relationships with B and many relationships. The rules removed for A are -> B "Cascade", and B -> A "No Action" B -> C is the rule for "no action", and C -> B is "taboo" .

I am having trouble deleting a unit. What I want to do is the following:

  1. I delete an example of A (use deleteObject: )
  2. Any B Remove the spread of
  3. All the beings connected with A. have been destroyed
  4. Any relationship of C whose associated B was destroyed was removed.
  5. It may be a little misleading, so summarize me: when AA is removed, remove all associated B And any In terms of C, they should not have any more context in reference to those B.

    In my trial, I do not have to "remove all my rules" cessed. When I delete an A, I immediately call processPendingChanges (only to ensure that deletion is done). Then I am comparing the number of A and B, which was in the NSMD object contact before deletion, and after that. Example of A has been properly removed (number of total A is now less than one before deletion). However, the number of B is the same. Therefore, it seems that the rule to remove "Cascade" is not being honored.

    I know that manually A -> B can go through the relationship, and manually remove each of the B. However, it seems that it offers some core data free, so I do not want to do this, as long as core data is not insufficient. Any information about "Cascade" removal rules is welcome.

I'm definitely not a core data expert, but reading, it seems to me that you < Strong> no action instead of B -> want to strengthen C relationship . Maybe BS is not going away because CS is still keeping reference on them?


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -