Re: Equivalent to NSLocalizedStringFromTable() for working with a XML?
Re: Equivalent to NSLocalizedStringFromTable() for working with a XML?
- Subject: Re: Equivalent to NSLocalizedStringFromTable() for working with a XML?
- From: Allan Odgaard <email@hidden>
- Date: Mon, 13 Sep 2004 19:13:43 +0200
On 13. Sep 2004, at 14:40, George Lawrence Storm wrote:
My query is if there is a function/macro that already exists which
will do what I need in a single call
None that I am aware of. I think you can get images, sounds, and nibs
loaded in one go, but the rest of your localized resources you'll have
to load yourself.
I guess arrayWithContentsOfFile: and dictionaryWithContentsOfFile:
really ought to use pathForResource:ofType: when the path is relative!
:)
I am asking prior to my writing one to do something similar for
property list formatted resource(s) and end up doing something in a
non-standard way (I don't want to reinvent the wheel for something
that seems so basic).
Something like this should suffice:
NSDictionary* dict = [NSDictionary dictionaryWithContentsOfFile:
[[NSBundle mainBundle] pathForResource:name ofType:@"plist"]];
Though it won't give you default values or fallback on other languages
for individual keys, though I wonder if you really need this
granularity?
--
http://macromates.com/ ::: TextMate, OS X text editor
http://macromates.com/sigpipe/ ::: Personal weblog about
programming
_______________________________________________
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