Tuesday, December 22, 2015

Core Data Deletion Rules Simplified

Person
- shoes (to many to 'Shoe')
         deletion rule is set to cascade


Shoe
- person (to one to 'Person')
        deletion rule is set to nullify

When I delete a 'Person' record all of person.shoes will be deleted as well.

When I delete a 'Shoe' record, shoe.person will not be deleted, rather the person.shoes relationship that used to be there will now be broken and the shoe reference nulled out and it will not have a reference to that shoe.

No comments:

Post a Comment