查找某个国家/地区的距离、货币、温度单位等 (iPhone) [英] Finding the distance, currency, temperature units etc. for a country (iPhone)
问题描述
在我的应用程序本地化期间,我浏览了很多文档,我确定我在某处读到有一种方法可以获取一组与语言环境相关联的单元.
During the localization of my app I went through a lot of documentation, somewhere Im sure I read that there is a way to get a set of units that is linked with the locale.
我相信它说的是基于文化的单位......"之类的东西.
I believe it said something like "units based on cultural..." something.
我想在某些国家/地区以华氏和英里显示温度和距离,在其他国家/地区以摄氏度和公里显示温度和距离.
I would like to display temperature and distance in Fahrenheit and Miles for some countries and Celsius and Kilometers for other countries.
有没有办法在 iPhone SDK 中访问这些单元的列表.
Is there a way to access a list of these units in the iPhone SDK.
谢谢.
推荐答案
你可以使用 NSLocale
来查看货币单位,但是英制和公制你需要自己做一个列表.
You can use NSLocale
to check the currency unit, but for imperial vs. metric you need to make a list yourself.
哎呀.您可以检查英制与公制.有 NSLocaleMeasurementSystem
和 NSLocaleUsesMetricSystem
键.
Oops. You can check for the imperial vs. metric. There is are NSLocaleMeasurementSystem
and NSLocaleUsesMetricSystem
keys.
这篇关于查找某个国家/地区的距离、货币、温度单位等 (iPhone)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!