Re: NSPropertyDescription userInfo
Re: NSPropertyDescription userInfo
- Subject: Re: NSPropertyDescription userInfo
- From: Jim Correia <email@hidden>
- Date: Sat, 5 Nov 2005 16:48:33 -0500
On Nov 5, 2005, at 1:21 PM, mmalcolm crawford wrote:
The localisation dictionary is set up lazily by the persistent
document.
That seems to be the case for non-document based CoreData apps as well.
If you do something in the user interface that requires a localised
string, it is retrieved correctly.
So if I need a localized name for my own purposes (say in a
validateFoo:error:} I'll need to ensure that it is initialized.
You can set up the dictionary directly yourself:
NSString *localizationDictionaryPath = [[NSBundle mainBundle]
pathForResource:@"MyDocumentModel" ofType:@"strings"];
NSDictionary *localizationDictionary = [NSDictionary
dictionaryWithContentsOfFile:localizationDictionaryPath];
[[self managedObjectModel]
setLocalizationDictionary:localizationDictionary];
In this case of a merged model though, it doesn't appear to be quite
so simple to make sure all the appropriate .strings files are loaded.
Unless there is a good reason not to that I'm not seeing, asking for
the localizationDictionary should trigger the lazy setup. If there
is, perhaps there should be another public way for me to ensure that
I can get back a localization dictionary, so I can always take
advantage of the localization auto setup done by the frameworks, and
don't have to roll my own.
I'll file an enhancement request.
Jim
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden