Find current country from iPhone device

前端 未结 9 1028
醉话见心
醉话见心 2020-12-04 08:38

I have to get the current country in the iPhone settings. Can anyone tell me how to get the current country in iPhone application.

I have to use the current country

9条回答
  •  情书的邮戳
    2020-12-04 09:10

    NSLocale *locale = [NSLocale currentLocale];
    NSString *countryCode = [locale objectForKey: NSLocaleCountryCode];
    NSString *country = [locale displayNameForKey: NSLocaleCountryCode value: countryCode];
    

提交回复
热议问题