• 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: UPDATE: Core Data Cascade delete rule sometimes doesn't -- maybe never? (all of a sudden)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UPDATE: Core Data Cascade delete rule sometimes doesn't -- maybe never? (all of a sudden)


  • Subject: Re: UPDATE: Core Data Cascade delete rule sometimes doesn't -- maybe never? (all of a sudden)
  • From: Adam Swift <email@hidden>
  • Date: Tue, 12 Feb 2008 16:09:56 -0800

I set up a trivial test with a model with Item and Link entities with relationships as you describe and I cannot reproduce the problem you are seeing (cascade deletes are working and do delete the related objects). Please file a bug.

On Feb 11, 2008, at 5:25 PM, Doug Knowles wrote:

It turns out that deletion of the object in question in any context (including the UI action that's been in place for many months).

To recap: I am deleting an NSManagedObject (called an "item") with a to-many relationship to a "link" entity, which has a to-one inverse relationship. The delete rule on the to-many relationship is "Cascade"; the delete rule on the inverse relationship is "Nullify". After deletion (and after processPendingChanges), the link entity is not deleted, and other entities retain a relationship with it (even though those relationships should have been nullified by the deletion of the link).

I haven't touched the model for weeks, maybe months, and this operation was working well after the last time I did change it. I'm starting to suspect a corruption in the model, but there doesn't seem to be an easy way to check it.

Doug K;

On Feb 11, 2008 4:27 PM, Doug Knowles <email@hidden> wrote:
Well, per the tech note, I do call processPendingChanges before I do the manual validation (which catches undeleted now-invalid objects). And my understanding is that processPendingChanges is automatically called on a Save, which is where I first encountered the invalid records.


The release note implies that Core Data is doing some work (like propagating deletions) at the top of the event loop; could it be that the processing of incoming AppleEvents is short-circuiting whatever Core Data normally does?


On Feb 11, 2008 2:19 PM, Adam Swift <email@hidden> wrote:

Have you tried manually calling "processPendingChanges" after the
delete?  Cascade deletes are not processed immediately:

http://developer.apple.com/releasenotes/Cocoa/CoreDataReleaseNotes/index.html



_______________________________________________

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: UPDATE: Core Data Cascade delete rule sometimes doesn't -- maybe never? (all of a sudden)
      • From: Andrea at Redmatica <email@hidden>
References: 
 >UPDATE: Core Data Cascade delete rule sometimes doesn't -- maybe never? (all of a sudden) (From: "Doug Knowles" <email@hidden>)

  • Prev by Date: Fwd: IOKit.framework - The Destruction of my Project
  • Next by Date: Toolbar items added to a toolbar not visible in Interface Builder 3
  • Previous by thread: UPDATE: Core Data Cascade delete rule sometimes doesn't -- maybe never? (all of a sudden)
  • Next by thread: Re: UPDATE: Core Data Cascade delete rule sometimes doesn't -- maybe never? (all of a sudden)
  • Index(es):
    • Date
    • Thread