Re: Core Data : Undo Delete : Cannot fulfill a fault
Re: Core Data : Undo Delete : Cannot fulfill a fault
- Subject: Re: Core Data : Undo Delete : Cannot fulfill a fault
- From: Quincey Morris <email@hidden>
- Date: Fri, 30 Sep 2011 14:39:41 -0700
On Sep 30, 2011, at 13:22 , Jerry Krinock wrote:
> The trick is the order in which they are deleted. If the child NewObject7 is deleted before its parent NewObject6, Undo will succeed. If the parent is deleted first, Undo will fail. In my app, the order is random due to enumerating an NSSet.
Yes, based on your last post I figured something like this, but I've been pondering where the "blame" lies.
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? Presumably not.
Also, do you invoke 'processPendingChanges' yourself during the enumeration, or do you just let it happen automatically?
Also, what's the delete rule for the child's "parent" relationship? Surely not "Cascade"?
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.
_______________________________________________
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