Re: NSManagedObjectContext -insertObject: Cancels Prior Deletion -- BUT!

2009-05-08 Thread Adam Swift
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:, th

Re: NSManagedObjectContext -insertObject: Cancels Prior Deletion -- BUT!

2009-05-08 Thread Jerry Krinock
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

Re: NSManagedObjectContext -insertObject: Cancels Prior Deletion -- BUT!

2009-05-07 Thread Jerry Krinock
On 2009 May 06, at 11:32, Jim Correia wrote: Using multiple MOCs with a single persistent store coordinator is supported. It is pattern #1 in the Core Data threading documentation. Thanks, Jim. I believe that moving the children to a "foster parent" before deleting the real parent would b

Re: NSManagedObjectContext -insertObject: Cancels Prior Deletion -- BUT!

2009-05-06 Thread Jim Correia
On Wed, May 6, 2009 at 1:05 PM, Jerry Krinock wrote: >> In any case using multiple MOCs for different jobs is a good idea. > > Accessing the same store?  I always thought that was a bad idea, but I'll > give it some thought. Using multiple MOCs with a single persistent store coordinator is suppo

Re: NSManagedObjectContext -insertObject: Cancels Prior Deletion -- BUT!

2009-05-06 Thread Jerry Krinock
On 2009 May 06, at 02:13, Alexander Spohr wrote: The MOC knows the objects is deleted. If you try to refetch it, the MOC has to clear all attributes because it does not exist anymore (in the MOCs view of the database). Is the primary key still the same? If it is not null now as well...

Re: NSManagedObjectContext -insertObject: Cancels Prior Deletion -- BUT!

2009-05-06 Thread Alexander Spohr
* now entering guessing-land * The MOC knows the objects is deleted. If you try to refetch it, the MOC has to clear all attributes because it does not exist anymore (in the MOCs view of the database). Is the primary key still the same? If it is not null now as well... * exit guessing-land *

Re: NSManagedObjectContext -insertObject: Cancels Prior Deletion -- BUT!

2009-05-05 Thread Jerry Krinock
Thanks for the answers, "yes" and "no", but I've found a problem doing so 1. Insert a managed object. 2. Set an attribute in the object. 3. Delete the object from its moc. 4. Execute a fetch request in the moc with no predicate. 5. Get the attribute from the object. Expected Result: T

Re: NSManagedObjectContext -insertObject: Cancels Prior Deletion?

2009-05-05 Thread Dave Fernandes
Yes... Begin forwarded message: From: Ben Trumbull Date: March 28, 2009 1:47:07 AM EDT (CA) To: Nick Zitzmann Cc: Cocoa Developers Subject: re: "Un-deleting" objects in an NSManagedObjectContext? -insertObject: is the reciprocal of deleteObject: You can use it to cancel a deletion. -

Re: NSManagedObjectContext -insertObject: Cancels Prior Deletion?

2009-05-05 Thread Alexander Spohr
Am 05.05.2009 um 07:44 schrieb Jerry Krinock: 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 t

NSManagedObjectContext -insertObject: Cancels Prior Deletion?

2009-05-04 Thread Jerry Krinock
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 [managedObj