• 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: NSManagedObject isDeleted returns NO after deleting object?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >NSManagedObject isDeleted returns NO after deleting object? (From: Jim Correia <email@hidden>)

  • Prev by Date: Setting Transient Values
  • Next by Date: Re: Setting Transient Values
  • Previous by thread: NSManagedObject isDeleted returns NO after deleting object?
  • Next by thread: C++ thread messaging cocoa thread
  • Index(es):
    • Date
    • Thread