views:

17

answers:

1

Can someone explain to me how .string files can be used in iPhone SDK similar to how .plist files can be converted into NSDictionaries?

Edit: I want to be able to use it like this:


NSDictionary *dict = [[NSDictionary alloc] initWithContentsOfFile:@"dict.plist"];
NS???? *strings = [[NS???? alloc] initWithContentsOfFile:@"Strings.strings"];


A: 

.string files just store key/value pairs, like:

"StringKey" = "some localized text";

you can get the text for a specific key using NSLocalizedString. If you want to get all the strings in a file, I suppose you could read the Localizable.strings file and parse it.

Marco Mustapic