- (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...] does not return the country name in iOS 8 , but the code above should solve your problem.
zyxman Oct 29 '14 at 10:25 2014-10-29 10:25
source share