I have this code to obtain a code country, but I want to see all code country available; then I can do some \"if\" to implement in my app
NSLocale *local
Better to rely on the NSLocale for countryCode & other language/locale dependent strings. For example: Egypt in Russian is Египет. Avoid using hardcoded country lists like https://stackoverflow.com/a/22660792/342794.
Use [NSLocale ISOCountryCodes].
// Example:
for (NSString *code in [NSLocale ISOCountryCodes])
{
// Convert the code to a name:
NSString *countryName = [[NSLocale currentLocale] displayNameForKey:NSLocaleCountryCode value:code];
}
From NSLocale.h; look at other similar properties
@property (class, readonly, copy) NSArray *availableLocaleIdentifiers;
@property (class, readonly, copy) NSArray *ISOLanguageCodes;
@property (class, readonly, copy) NSArray *ISOCountryCodes;
@property (class, readonly, copy) NSArray *ISOCurrencyCodes;
@property (class, readonly, copy) NSArray *commonISOCurrencyCodes;