shannoga
shannoga

Reputation: 19869

CoreData - Does changing one side of relation ship effects the other side

I have a one to many relationship between Animal and Exhibit. One Exhibit can contain many animals.

  1. Does changing the animal exhibit will automatically change the other side and remove the animal from the exhibit, or should I do from the other side too?
  2. Does setting exhibit.animals = nil removes all the relationships ?

Thanks

Shani

Upvotes: 1

Views: 57

Answers (1)

Nikita Pestrov
Nikita Pestrov

Reputation: 5966

  1. Yes, if you have reverse relationship between Exhibit and Animal
  2. Yes, it will delete all the relationships, but wether it deletes the Exhibits themselfe, depends on Delete Rule.

Upvotes: 1

Related Questions