• 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: NSManagedObjectContext -insertObject: Cancels Prior Deletion?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSManagedObjectContext -insertObject: Cancels Prior Deletion?


  • Subject: Re: NSManagedObjectContext -insertObject: Cancels Prior Deletion?
  • From: Dave Fernandes <email@hidden>
  • Date: Tue, 5 May 2009 08:28:35 -0400

Yes...


Begin forwarded message:
From: Ben Trumbull <email@hidden>
Date: March 28, 2009 1:47:07 AM EDT (CA)
To: Nick Zitzmann <email@hidden>
Cc: Cocoa Developers <email@hidden>
Subject: re: "Un-deleting" objects in an NSManagedObjectContext?


-insertObject: is the reciprocal of deleteObject: You can use it to cancel a deletion.


- Ben





On May 5, 2009, at 1:44 AM, Jerry Krinock wrote:

I have a tree of managed objects with parent <--> child relationships, and Delete Rule set to Cascade children when a parent is deleted.

But sometimes, after deleting a parent, I need to restore a deleted child under a new parent. So I set the new relationships and also send

   [managedObjectContext insertObject:deletedObject] ;

It appears that -insertObject: "cancels" the object's previous Cascade-deletion. It definitely does not persist as desired if I don't to this.

But of course since my situation is rather odd it is not covered in "Creating and Deleting Managed Objects" of the "Core Data Programming Guide". Is what I'm doing OK?

Thanks,

Jerry Krinock
_______________________________________________

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:
40utoronto.ca


This email sent to email@hidden


_______________________________________________

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


  • Follow-Ups:
    • Re: NSManagedObjectContext -insertObject: Cancels Prior Deletion -- BUT!
      • From: Jerry Krinock <email@hidden>
References: 
 >NSManagedObjectContext -insertObject: Cancels Prior Deletion? (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: Registering Clients using DO
  • Next by Date: Re: Trouble with property (copy) and retain counts
  • Previous by thread: Re: NSManagedObjectContext -insertObject: Cancels Prior Deletion?
  • Next by thread: Re: NSManagedObjectContext -insertObject: Cancels Prior Deletion -- BUT!
  • Index(es):
    • Date
    • Thread