- (NSString *)countryNameByCode:(NSString*)countryCode { NSString *identifier = [NSLocale localeIdentifierFromComponents:@{NSLocaleCountryCode: countryCode}]; NSStrin
- (NSString *)countryNameByCode:(NSString*)countryCode
{
NSString *identifier = [[NSLocale preferredLanguages] firstObject];
NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:identifier];
NSString *countryName = [locale displayNameForKey:NSLocaleIdentifier value:countryCode];
return countryName;
}
I don't understand why [[NSLocale currentLocale] displayNameForKey...]
doesn't return country name in iOS 8
but the code above should resolve your problem.