I need two NSArray one with all countries and the other one with the corresponding LocaleIdentifier.

Like:

  NSArray *countries = @[@"United States", @"Brazil", @"Spain"];
  NSArray *identifiers = @[@"en_US", @"pt_BR", @"sp_SP"];

So if anyone could lead me how can I get this programmatically or any other source I'd be thankful!

有帮助吗?

解决方案

Here is a list of locale identifiers and their country name:

https://gist.github.com/jacobbubu/1836273

其他提示

You should try using NSLocale displayNameForKey:value: as explained on this link

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top