This looks very scary to me...  Why would you be inserting objects into the editing context here?

You should never set an object as a relationship until AFTER it's inserted into the editing context that the receiver is already in.

My code never strays from:

Address address = new Address();
ec.insertObject(address);

Never.

You can always delete it from the EC if you need to.

Ken

On Aug 27, 2006, at 10:31 AM, Yann Bizeul wrote:

Is this code WOSpirit complient ?

public void awakeFromInsertion(EOEditingContext ec)
{
super.awakeFromInsertion(ec);

setDate(new NSTimestamp());
if (address().editingContext() == null)
ec.insertObject(address());

int i=0;
for (i=0;i<locationTagUsers().count();i++)
{
LocationTagUser l = (LocationTagUser) locationTagUsers().objectAtIndex(i);
if (l.editingContext() == null)
ec.insertObject(l);
}
}

Yann Bizeul • yann at tynsoe.org
Cocoa Developer

Tynsoe Projects
BuddyPop • GeekTool • SSH Tunnel Manager • ...


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:

This email sent to [EMAIL PROTECTED]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to archive@mail-archive.com

Reply via email to