Sandro
Sandro

Reputation: 3160

Delete rule for child entity in core data

I am a bit confused by this message sent by Xcode:

Setting the No Action Delete Rule on Passenger.taxi is an advanced setting [5]

Parent- and Child-Entity

These are the specifications

  1. When I delete a Taxi instance, it should also delete all its Passenger instances. Current Delete Rule: Cascade
  2. When I delete a Passenger instance, it should just delete that particular instance. Even if it is the last Passenger instance of a Taxi instance. A Taxi can exist without Passengers (1:mc). Current Delete Rule: No Action

What delete rule do I need here to meet the requirements?

Upvotes: 4

Views: 2170

Answers (1)

Set the delete rule to nullify, which simply nils out the link. "No Action" is a bit weird in that you can think of it as leaving a pointer that does not really exist I'm not sure if that's what it would really do).

Upvotes: 5

Related Questions