• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Core Data: Delete stops at first object in Cascade
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data: Delete stops at first object in Cascade


  • Subject: Re: Core Data: Delete stops at first object in Cascade
  • From: Jerry Krinock <email@hidden>
  • Date: Sun, 8 Feb 2009 20:07:52 -0800

I got a suggestion off-list that maybe cascade-deleting would be inhibited if the relation was "optional". In my real project, all my relationships are optional. The "Delete Rule" documentation makes no mention of "optional" settings affecting what happens, but I thought I'd test this suggestion anyhow.

Thanks to the the Core Data Entity in Interface Builder, I whipped up and tested a little demo project with just the four entities as shown below, a "number" attribute for each, "to many" and "Delete Rule" settings as shown, and all six relationships optional. Result: Deleting X deletes B and T, as expected and desired.

So there must be some other factor in my real project that is causing T to be not deleted when I delete X. Performing a "Save As" and examining the XML, I have confirmed that X and B are definitely being deleted. My real project has other entities connected to X and J on the right and left, and of course the entities in my real project have lots more attributes.

Does anyone know of any other factor that might prevent an object from being cascade-deleted?

Thanks,

Jerry Krinock

        Cascade--->   Cascade-->>   Nullify--->
 -->> X             B             T             J <<--
        <<--Nullify   <---Nullify   <<--Cascade

In my real project, X and J have relationships to other objects in the greater graph, but B and T have only those shown. B is always added to and "owned by" an X. T is a lightweight object which the user can easily recreate. In a popup menu, the user can select any available B for a T, but the relationship is optional because not all "types" of T are can have a B.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Core Data: Delete stops at first object in Cascade
      • From: Jerry Krinock <email@hidden>
References: 
 >Core Data: Delete stops at first object in Cascade (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: Drag and drop images to other application using NSFilesPromisePboardType
  • Next by Date: Re: Mixing C++ and Objective-C
  • Previous by thread: Core Data: Delete stops at first object in Cascade
  • Next by thread: Re: Core Data: Delete stops at first object in Cascade
  • Index(es):
    • Date
    • Thread