iPhone-MKReverseGeocoder.adminstrativeArea-获取状态缩写 [英] iPhone -- MKReverseGeocoder.adminstrativeArea -- getting state abbreviation

查看:76
本文介绍了iPhone-MKReverseGeocoder.adminstrativeArea-获取状态缩写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在MKReverseGeocoder的文档中,管理区域属性为您提供了用户所处的当前状态,并在示例中提到它返回状态名称或其缩写.我想知道是否有人知道缩写而不是全州名称...除了没有提到HOW的简短示例外,我什么都找不到,甚至没有显示这种可能性.

In the documentation for MKReverseGeocoder, the administrativeArea property gives you the current state the user is in, and it mentions in an example that it returns EITHER the state name OR its abbreviation. I am wondering if anyone knows how to get the abbreviation instead of the full state name...I have been able to find nothing that shows this is even a possibility besides that brief example that doesn't mention HOW.

谢谢!

推荐答案

无法执行此操作.不知道为什么苹果文档会说"CA或California".

There is no way to do this. Not sure why the Apple docs say "CA or California".

将状态转换为2个字母的名称很容易.只需创建以下内容的plist(表或NSDictionary作品): http://www.usps.com/ncsc/lookups/usps_abbreviations.html 并使用它来查找2个字母的缩写.

It's easy to convert state to 2 letter name. Just create a plist (table, or NSDictionary works too) of the following: http://www.usps.com/ncsc/lookups/usps_abbreviations.html and use that to look up the 2 letter abbreviations.

这篇关于iPhone-MKReverseGeocoder.adminstrativeArea-获取状态缩写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆