问题
Given a country, how do I get the countryCode? The following method is not working
NSNumber* code = [phoneUtil getCountryCodeForRegion:country];
回答1:
It is working, I used it like so:
[phoneUtil getCountryCodeForRegion:@"US"]
and the output was 1.
Note that you have to use the ISO Country Code, 2 Digit: "US", (you can find a list here).
来源:https://stackoverflow.com/questions/25879186/libphonenumber-ios-get-country-code-for-country