refreshing and relationships
refreshing and relationships
- Subject: refreshing and relationships
- From: Tom Woteki <email@hidden>
- Date: Sun, 15 Jan 2006 12:33:23 -0500
I'm stumped. I guess I'm just overlooking something very obvious. I'm
hoping that some wiser head hereabouts can help me. Thanks in advance.
My problem is not the usual one implied by the subject line. I am
_not_ trying to refresh data in a to-many relationship that may have
been changed in another object store. For purposes of my problem you
can assume there is only one object store, one editing context (the
session's default) and one user involved.
I have a source object, sourceObj, with a to-many relationship. Say
the relationship key is "targets" . I obtain the related objects by
invoking sourceObj.targets() where the method targets() returns an
NSArray as a cover for a call to storedValueForKey( "targets" ).
I now invoke:
/* Assume editingContext exists and all EOs are in it */
editingContext.deleteObject( aSpecificTargetObject )
Upon subsequent invocations of targets() (and prior to saveChanges())
the returned array contains the target object I just deleted. This is
my problem: I think that object should no longer be in the array.
It seems the only way I can see the effects of the deletion is by
executing this sequence:
editingContext.deleteObject( aSpecificTargetObject );
editingContext.saveChanges();
editingContext.refreshObject( sourceObject ); /* If I don't do this I
still see the deleted object */
However, I don't want immediately to save the changes, so this
approach is unsatisfactory to me. (And I prefer not to use display
groups.)
Any ideas?
Thanks
Tom
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden