4

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?

Sandro
  • 2,998
  • 2
  • 25
  • 51
  • 1
    See http://stackoverflow.com/questions/5629481/xcode-consistency-error-setting-the-no-action-delete-rule-is-an-advanced-sett – Stanislav Yaglo Oct 11 '11 at 15:16
  • That is a much more detailed explanation than the one I gave. – Kendall Helmstetter Gelner Oct 11 '11 at 15:23
  • I skim-read that answer while trying to resolve the warning. But he explained it mainly for a 1:1 relationship. And the part about the m:n relationship is not clear to me (It does not explain my 2. spec). – Sandro Oct 11 '11 at 15:45

1 Answers1

5

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).

Kendall Helmstetter Gelner
  • 74,769
  • 26
  • 128
  • 150
  • Nullifying leads to the strange behavior - I can't fetch this entity anymore from data base! At least this occurs using MagicalRecord. The weird is to have the option which leads to 100% error occuring...the TS mentioned the a taxi CAN EXIST WITHOUT any passenger – Stas Aug 01 '13 at 16:15
  • Try dumping the full set of Taxi entities after the nil takes place. it should still be there. It's not impossible there's some kind of bug in MagicalRecord around this. – Kendall Helmstetter Gelner Aug 01 '13 at 17:18
  • I've asked a question here, kindly ask you to take a look http://stackoverflow.com/questions/18000640/magical-record-deleting-entity-issue – Stas Aug 01 '13 at 17:27