| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
Hi Ted,
...
So, at the page
level, I create a peer ec:
EOEditingContext _peerEC = ERXEC.newEditingContext();
and then use it to create the new objects:
MyEO eo = (MyEO)EOUtilities.createAndInsertInstance(_peerEC, "MyEO");
There are plenty of gotchas to be aware of here, mainly that if you
are relating your newly created objects to objects that are contained
in another editing context, you have to first bring those other
options into the peer:
OtherEO oeo = (OtherEO)EOUtilities.localInstanceOfObject(_peerEC, oeo);
(or use EOUtilities.localInstancesOfObjects(EOEditingContext, NSArray
to do a whole set at once).
Hope this helps. Getting past these issues was a bitter struggle for
me, and I wasn't even aware of all of the various problems (like
having to have an EO in and editing context before doing ANYTHING to
it) for several years. Trust me, better to start off following the
rules people have figured out from experience than to have to go back
later and refactor tons of code to fit those rules.
Mark
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/email@hidden This email sent to email@hidden
| References: | |
| >Nested Editing Contexts (From: "Ted Archibald" <email@hidden>) | |
| >Re: Nested Editing Contexts (From: Steven Mark McCraw <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.