I have the following code:
NSArray *_countryCodes = [NSLocale ISOCountryCodes];
NSMutableArray *names = [NSMutableArray arrayWithCapacity:_countryCodes.count];
[_countryCodes enumerateObjectsUsingBlock:^(NSString *code, NSUInteger idx, BOOL *stop) {
NSString *displayName = [[NSLocale currentLocale] displayNameForKey:NSLocaleCountryCode value:code];
if (displayName != nil) {
names[idx] = displayName;
}
}];
For less than 0.2% of my users _countryCodes
seems to be empty (in fact I got debug message, that names
are empty).
All affected devices are on iOS 10.1/10.2 and have en_PH
locale.
Any ideas what might be the reason?