ios - 确定系统的距离单位
我一直无法找到这个问题的答案。
我使用 CLLocation
方法 distanceFromLocation
来获取两个坐标之间的距离,但该方法返回以米为单位的距离。
根据设备的区域设置,我希望能够动态确定是否应该将其转换为英里(例如,如果用户是美国人)
所以这不是如何转换的问题,而是何时转换的问题有
什么想法吗?
Possible Duplicate:
Finding the distance, currency, temperature units etc. for a country (iPhone)
I haven't been able to find an answer to this question.
I am using the CLLocation
method distanceFromLocation
to get the distance between two coordinates, but the method returns the distance in meters.
Depending on the device's region settings I want to be able to dynamically determine if I should convert this to miles (e.g. if the user is american)
So this is not a question of HOW to convert but WHEN to convert
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以查询区域设置,然后建议米或英里。最好的办法是使其可供选择。当设备所有者的姓氏如库克、德雷克等时,您可以添加选项“海里”。
You could query the locale and then propose meters or miles. Best is to make it selectable. When the device owner's last name is like Cook, Drake etc. you could add a choice "nautic miles".