Re: EOEditingContext in Application
Re: EOEditingContext in Application
- Subject: Re: EOEditingContext in Application
- From: Lachlan Deck <email@hidden>
- Date: Tue, 1 Jul 2008 14:05:21 +1000
On 01/07/2008, at 1:25 PM, Drew Thoeni wrote:
I'm not even sure I know enough to ask this question correctly, but
here goes.
I'm trying to make an application more efficient by moving the code
table lists from the session to the application.
To do so, though, I need an editing context to hold the lists. But,
I can't use the defaultEditingContext as I don't have a session upon
application start.
So, I (wrongly, it seems) created an editing context in the
application.
Nothing wrong with that per se. But what you want is a better api so
as to treat them like read-mostly data.
Clearly because I have two editing contexts and the session one
(defaultEditingContext) can't see the objects in the one shown below
(appEC).
So, if I want to make efficient use of memory by storing these
rarely changing code table lists in the application, how does one go
about storing them in an EC that the sessions can get to?
Two options:
1) EOSharedEditingContext.
2) localize your eos
public NSArray<Language> languageList(EOEditingContext ec) {
NSArray results =
EOUtilities.objectsWithFetchSpecificationAndBindings( appEC,
"Language", "FetchAllAvailableLanguages", null );
return EOUtilities.localInstancesOfObjects(ec, results);
}
with regards,
--
Lachlan Deck
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden