Created
May 22, 2015 15:48
-
-
Save MaximAlien/c3b9a30f4c8c3924877d to your computer and use it in GitHub Desktop.
[iOS] GetCountriesList
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSMutableArray *countries = [[NSMutableArray alloc] init]; | |
NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier: @"en_US"]; | |
NSArray *countryArray = [NSLocale ISOCountryCodes]; | |
for (NSString *countryCode in countryArray) | |
{ | |
NSString *displayName = [locale displayNameForKey:NSLocaleCountryCode value:countryCode]; | |
[countries addObject:displayName]; | |
} | |
[countries sortUsingSelector:@selector(compare:)]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment