Re: NSManagedObjectContext -insertObject: Cancels Prior Deletion -- BUT!
Re: NSManagedObjectContext -insertObject: Cancels Prior Deletion -- BUT!
- Subject: Re: NSManagedObjectContext -insertObject: Cancels Prior Deletion -- BUT!
- From: Adam Swift <email@hidden>
- Date: Fri, 8 May 2009 14:10:22 -0700
On May 8, 2009, at 1:00 PM, Jerry Krinock wrote:
Conclusion. Here's what I believe to be the "missing
documentation"...
***
"You can use -insertObject: to cancel a prior deletion, however if
certain operations are performed after the deletion and before the
restoring -insertObject:, the attributes of the deleted/inserted
object will all be set to nil. These certain operations include,
but may not be limited to,
-[NSManagedObjectContext executeFetchRequest:error:]
-[NSManagedObjectContext save:]
Regarding the former, note that the deleted objects need not be (and
will not be, because they are deleted) included in the fetch results
in order to have their attributes hosed.
That looks correct and a bug report/documentation enhancement request
is reasonable, but note that deleted objects will only have their
attributes cleared if:
(a) the object is newly inserted (doesn't exist in the persistent
store) and
(b) no 'undo tracking event (ie user event)' occurs between the
creation/insert and subsequent delete. You can trigger the same
effect of an undo event boundary by calling "processPendingChanges".
- adam
_______________________________________________
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