Thursday, December 4, 2014

Country Code and Country Name from NSLocale

NSLocale *locale = [NSLocale currentLocale];
NSString *countryCode = [locale objectForKey: NSLocaleCountryCode];

NSLocale *usLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"];

NSString *country = [usLocale displayNameForKey:NSLocaleCountryCode value:countryCode];

No comments: