Re: Updating / Replacing Parent Objects
Re: Updating / Replacing Parent Objects
- Subject: Re: Updating / Replacing Parent Objects
- From: Lotsa Cabo <email@hidden>
- Date: Sun, 1 Aug 2004 17:45:07 -0400
On Aug 1, 2004, at 5:30 PM, Dirk Bajohr wrote:
> If you have a relationship between the two entities you
> can call removeObjectFromBothSidesOfRelationshipWithKey() and
> addObjectToBothSidesOfRelationshipWithKey(). If the relation is
> to-1 you only need to use the second method.
>
> myPost is the Post to be changed, newForum is your new Forum:
>
> myPost.addObjectToBothSidesOfRelationshipWithKey(newForum, "forum");
> myPost.editingContext().saveChanges();
> - or -
> newForum.addObjectToBothSidesOfRelationshipWithKey(myPost, "posts");
> newForum.editingContext().saveChanges();
>
Thanks for the reply, Dirk. In your examples above are you assuming
that "removeObjectFromBothSidesofRelationshipWithKey()" has already
been called? I notice you mentioned the method but did not include it
in either example.
R/S
Ryan
_________________________
Tired of spam? Signup for a FREE SpamJammer.Com account and say
goodbye to junk email forever!
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.