re: Code Data: Re-inserting deleted objects

2008-10-06 Thread Ben Trumbull
Chaitanya, What is the best way to re-insert a deleted object back in to the managed object context? -insertObject: will reinsert a deleted object. -insertObject and - deleteObject will cancel each other out. Typically, one wouldn't validateForInsert until after reinserting the object,

Re: Re-inserting deleted objects

2008-10-02 Thread chaitanya pandit
On 03-Oct-08, at 3:23 AM, Harry Jordan wrote: If deleting the objects was the last action that you did, you could simply call -undo on the managedObjectContext. There may well be reasons why this wouldn't be appropriate, but it's worth a look. Actually thats the first thing that came to my

Code Data: Re-inserting deleted objects

2008-10-02 Thread chaitanya pandit
Hi List, What is the best way to re-insert a deleted object back in to the managed object context? At present i'm trying to this: if ([objectToReinstate validateForInsert:&error]) [[self managedObjectContext] insertObject:objectToReinstate]; But i am having problems with objects having relat