Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个应用程序,我正在制作一个基本的内置网络浏览器,用于预填充书签。
但我想获取设备的国家域代码,例如 .com、.uk、.de 等。这可能吗?
我知道如何使用国家代码,NSLocale但它给出的是 GB 而不是 uk。
NSLocale
使用if.
if
国家代码在 ISO-3166 中定义,并与国家代码顶级域相匹配。唯一的例外是英国,其 ISO-3166 为 GB,但它继续使用在编写 ISO-3166 之前定义的 .uk 域。