Holger Hoffstaette <[EMAIL PROTECTED]> wrote:

> While it is definitely possible to 'copy' EOs, you shouldn't try to do it
> unless you really know and understand what you're doing; otherwise you're
> compromising the integrity of your database and will only be rewarded with EOF
> on fire.

At similar situation exists when you want to set default values for inserted objects managed by a WODisplayGroup. The EO I use has an attribute which identifies the user which created the object or made the last change however when attempting to specify the user EO as a default value:

[defaultValues setObject:[[self session] login] forKey:@"lastModifiedBy"];
[displayGroup setInsertedObjectDefaultValues:defaultValues];


I get a copyWithZone exception thrown as the NSDictionary attempts to copy the session login object.

Any ideas as to what the root cause is in EOF (other than "don't copy EO's") and any suggestions as to possible workarounds ? The only solution I've seen from the archives in to override copyWithZone: so that it implements the method with [self retain] but that strikes me as somewhat unwise.

Stuart
_________________________________________
Stuart MacKay
Architect, Platinum Technology
11100 NE 8th Street, Suite 400, Bellevue, WA 98004

Reply via email to