• 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 : Undo Delete : Cannot fulfill a fault
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data : Undo Delete : Cannot fulfill a fault


  • Subject: Re: Core Data : Undo Delete : Cannot fulfill a fault
  • From: Jerry Krinock <email@hidden>
  • Date: Fri, 30 Sep 2011 16:50:40 -0700

On 2011 Sep 30, at 14:39, Quincey Morris wrote:

> It would be interesting to know this: if you manually break the parent-child relationships before actually deleting either the parent or the child, does the order of the deletions matter?

Invoking either -setParent:nil or -setChildren:nil on the object before invoking -[NSManagedObjectContext deleteObject:] fixes the problem.

> Also, do you invoke 'processPendingChanges' yourself during the enumeration, or do you just let it happen automatically?

I do not processPendingChanges when deleting an object.  Doing so after invoking -[NSManagedObjectContext deleteObject:] is another way to fix the problem.

> Also, what's the delete rule for the child's "parent" relationship? Surely not "Cascade"?

Nullify.

> If the delete rule for the parent's "children" relationship is "Cascade", then you're (conceptually) asking for the child to be deleted twice (once when the parent is explicitly deleted, once when the child is explicitly deleted during the enumeration). I've no doubt this is safe enough in terms of the deletions themselves, but I'm wondering if the way the sequence of undo steps get recorded for this just isn't robust enough in the case where the deleted objects are expunged (faulted out and removed from the persistent store) before the undo happens.

Yes, remember that inserting the objects and saving are necessary in the Steps to Reproduce.

Pruning and unpruning trees is often hairy.  You think you've thought through all of the possibilities, but then one day you find yourself sitting on a disconnected limb.

_______________________________________________

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

References: 
 >Core Data : Undo Delete : Cannot fulfill a fault (From: Jerry Krinock <email@hidden>)
 >Re: Core Data : Undo Delete : Cannot fulfill a fault (From: Richard Somers <email@hidden>)
 >Re: Core Data : Undo Delete : Cannot fulfill a fault (From: Jerry Krinock <email@hidden>)
 >Re: Core Data : Undo Delete : Cannot fulfill a fault (From: Dave Fernandes <email@hidden>)
 >Re: Core Data : Undo Delete : Cannot fulfill a fault (From: Jerry Krinock <email@hidden>)
 >Re: Core Data : Undo Delete : Cannot fulfill a fault (From: Dave Fernandes <email@hidden>)
 >Re: Core Data : Undo Delete : Cannot fulfill a fault (From: Jerry Krinock <email@hidden>)
 >Re: Core Data : Undo Delete : Cannot fulfill a fault (From: Quincey Morris <email@hidden>)
 >Re: Core Data : Undo Delete : Cannot fulfill a fault (From: Jim Correia <email@hidden>)
 >Re: Core Data : Undo Delete : Cannot fulfill a fault (From: Quincey Morris <email@hidden>)
 >Re: Core Data : Undo Delete : Cannot fulfill a fault (From: Jerry Krinock <email@hidden>)
 >Re: Core Data : Undo Delete : Cannot fulfill a fault (From: Jim Correia <email@hidden>)
 >Re: Core Data : Undo Delete : Cannot fulfill a fault (From: Jerry Krinock <email@hidden>)
 >Re: Core Data : Undo Delete : Cannot fulfill a fault (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Receiving Crash Reports
  • Previous by thread: Re: Core Data : Undo Delete : Cannot fulfill a fault
  • Next by thread: Re: Core Data : Undo Delete : Cannot fulfill a fault
  • Index(es):
    • Date
    • Thread