They say you should always put an EO object in an editing context before doing 
anything else.

Therefore, I subclass the decoder and put the editing context in it so it can 
be used on creation.

Something like this:

public MyObject(WOXMLDecoder decoder) {
        super();

        EOEditingContext ec = ((MyXMLDecoder)decoder).editingContext();
        ec.insertObject(this);

        setName((String)decoder.decodeObjectForKey("name"));
        setType((String)decoder.decodeObjectForKey("type")); 
}


Steve

On Mar 5, 2010, at 4:54 AM, Robin Smith wrote:

> Hi All,
> 
> Bit of a basic question but i was wondering if this is "allowed".
> 
> If i create an array of EO's for example using XMLCoder they don't get
> placed in an EC. Is
> it ok to iterate through the array and only insert the EO's i actually
> want to keep into my EC
> allowing the other ones to disappear off into the void. Or is this bad
> practice, should they all
> get put into an EC and then dealt with from there.
> 
> Many Thanks
> 
> 
> Robin
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/webobjects-dev/speery%40me.com
> 
> This email sent to [email protected]

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

This email sent to [email protected]

Reply via email to