Re: Converting a .strings text file to a NSArray or NSDictionary
Re: Converting a .strings text file to a NSArray or NSDictionary
- Subject: Re: Converting a .strings text file to a NSArray or NSDictionary
- From: Dev WO <email@hidden>
- Date: Thu, 28 Sep 2006 10:01:21 +0200
Hello Atze:)
Am 27.09.2006 um 21:16 schrieb Chuck Hill:
I'll be using it for 3 type of thing:
-get a complete NSDictionary or NSArray from a .strings
NSPropertyListSerialization already does that.
a .strings file is not a valid plist. so it does not.
you have to convert them to a plist (add the {}, as you already
told xavier) before NSPropertyListSerialization can read them.
the {} are already in there. I'm not sure I understand Atze, does
NSPropertiyListSerialization can handle .string files with {}?
-get a partial NSDictionary or NSArray from a .strings based on a
qualifer like "key contains xxxxx" (easy if I can get a complete
NSArray)
It won't do that.
why not? do you know what xavier needs that for?
After thinking about this one, I'm not sure I'll really need it. So
it's not a "must have" anyway;)
-create a reverse NSDictionary/Array from value to key (I know
I'll have to ensure the uniqueness of the value on my own if I do
that)
What would be the best way to approach this? and maybe some
pointer for the following steps;)
I'd still use NSPropertyListSerialization and use another class to
get the last two points from above.
agreed, i never use .strings-files because a plist is more dynamic
to use.
xavier, just forget those .strings and convert them all to
dictionary-plists.
As it seems I'm not using the "good" way to do it, I agree to go for
plist;) just 2 questions:
-WOResourceManager.stringForKey works the same way on plist
and .strings file? (I feel like I'm asking a dumb question...)
-Is there a "tool" I could use to convert my already
existing .strings files (they are quite long)?
you could even use xml in those files.
see http://www.apple.com/DTDs/PropertyList-1.0.dtd
Thanks Atze:)
Xavier
_______________________________________________
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