I'm using this code to get the list of countries:
for (NSString *code in [NSLocale ISOCountryCodes])
{
NSString *identifier = [NSLocale localeIdentifierFromComponents:@{NSLocaleCountryCode: code}];
NSString *countryName = [[NSLocale currentLocale] displayNameForKey:NSLocaleIdentifier value:identifier];
NSLog(countryName);
}
This works fine in iOS 7.x but fails in iOS8 (beta 2) - with countryName always being nil.
Anyone found an alternative yet?
I have also faced with such issue on iOS 8. Try to use systemLocale instead of currentLocale.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With