I am using the below code for Code and Country name but it returns null.
NSLocale *locale = [NSLocale currentLocale];
NSString *countryCode = [locale objectForKey: NSLocaleCountryCode];
NSString *country = [locale displayNameForKey: NSLocaleCountryCode value: countryCode];
NSLog(@"Language : %@ Lang2 : %@",[[[NSBundle mainBundle] preferredLocalizations] objectAtIndex:0],[[NSLocale preferredLanguages] objectAtIndex:0]);
NSLog(@"Locale:%@ Code:%@ Name%@:", locale, countryCode, country);
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
fr,
de,
nl,
ja,
es,
tr,
it,
pl,
pt,
);
Logs : Locale:<__NSCFLocale: 0x7fbef943f810> Code:(null) Name(null)
Language : nl Lang2 : nl
Tested both on device and simulator.i don't know whats going on here.It should work fine.Please let me know if you guys have any idea.i am using xcode 6.4.