Re: NSManagedObject isDeleted returns NO after deleting object?
Re: NSManagedObject isDeleted returns NO after deleting object?
- Subject: Re: NSManagedObject isDeleted returns NO after deleting object?
- From: mmalcolm crawford <email@hidden>
- Date: Thu, 14 Jul 2005 14:03:08 -0700
On Jul 14, 2005, at 12:15 PM, Jim Correia wrote:
If I insert a managed object into a context, then delete it
(without ever having saved the context), [object isDeleted] returns
NO.
Likewise [managedObjectContext deletedObjects] is empty.
This also results in the paradoxical situation where in the
NSManagedObjectContextObjectsDidChangeNotification there may be
objects in the deleted objects list (NSDeletedObjectsKey) who
return NO for [object isDeleted].
-isDeleted means, "will be deleted during the next save", or put
another way, "this object is marked deleted for the current (pending)
transaction".
The apparent paradox you identify the dichotomy between what the UI
considers a "deletion" and what the persistence store considers a
deletion.
[managedObjectContext deletedObjects] gives "objects we will ask the
store to delete during the next save"
The NSManagedObjectContextObjectsDidChangeNotification's
NSDeletedObjectsKey gives "objects the user marked for deletion
during the previous event"
One has to do with persistence. The other with UI & controllers.
Is this a bug (which I'll go off and report ASAP) or am I
misunderstanding something?
Please file a documentation bug to clarify this.
mmalc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden