libphonenumber ios获取国家/地区的国家/地区代码 [英] libphonenumber ios get country code for country
本文介绍了libphonenumber ios获取国家/地区的国家/地区代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
给出一个国家,我如何获得国家代码?以下方法无效
Given a country, how do I get the countryCode? The following method is not working
NSNumber* code = [phoneUtil getCountryCodeForRegion:country];
推荐答案
它正在工作,我这样使用它:
It is working, I used it like so:
[phoneUtil getCountryCodeForRegion:@"US"]
,输出为1.
注意,您必须使用ISO国家/地区代码2位数字:"US"(您可以找到列表此处).
Note that you have to use the ISO Country Code, 2 Digit: "US", (you can find a list here).
这篇关于libphonenumber ios获取国家/地区的国家/地区代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文