我正在使用 NSLocale 来确定我当前的国家/地区,然后将其作为参数传递给我的网络服务,但我无法通过此测试其他国家/地区,例如非洲等。有没有办法测试这个?我这样做是为了获得国家名称:
NSLocale *locale = [NSLocale currentLocale];
NSString *countryCode = [locale objectForKey: NSLocaleCountryCode];
NSString *countryName = [locale displayNameForKey: NSLocaleCountryCode value: countryCode];
谢谢,