iOS 使用CLGeocoder获取地理位置
placemark(MKPlacemark类的对象)其实是geocoder(MKReverseGeocoder类的对象)的一个属性。从geocoder里面取placemark这个和直接取placemark这个其实区别不大。而我们需要的信息主要就在这个里面了。
// 这个字典存放基础数据
@property (nonatomic, readonly) NSDictionary *addressDictionary;
让我们试试看,能从这个字典里面倒出来些什么东西。
以下是我用这个addressDictionary属性倒出来的字典。我们分析看看。
{
City = "\U897f\U5b89\U5e02";// 城市名字
Country = "\U4e2d\U56fd";// 国家名字
CountryCode = CN;// 国家编码
FormattedAddressLines = (
"\U4e2d\U56fd",
"\U9655\U897f\U7701\U897f\U5b89\U5e02\U96c1\U5854\U533a",
"\U9ad8\U65b0\U516d\U8def34\U53f7"
); // 这个应该是格式化后的地址了
State = "\U9655\U897f\U7701"; // 省
Street = "\U9ad8\U65b0\U516d\U8def 34\U53f7";// 街道完整名称
SubLocality = "\U96c1\U5854\U533a";//区名
SubLocality = "\U6816\U971e\U533a";
SubThoroughfare = "34\U53f7";//具体地址
Thoroughfare = "\U9ad8\U65b0\U516d\U8def";//街道名称
}

注意:上面的这个字典是可以直接转化为联系人的字典的,通过这个ABCreateStringWithAddressDictionary属性。
以下是placemark的其他属性。大家可以随意取用。
// address dictionary properties
@property (nonatomic, readonly) NSString *name; // eg. Apple Inc.
@property (nonatomic, readonly) NSString *thoroughfare; // street address, eg. 1 Infinite Loop
@property (nonatomic, readonly) NSString *subThoroughfare; // eg. 1
@property (nonatomic, readonly) NSString *locality; // city, eg. Cupertino
@property (nonatomic, readonly) NSString *subLocality; // neighborhood, common name, eg. Mission District
@property (nonatomic, readonly) NSString *administrativeArea; // state, eg. CA
@property (nonatomic, readonly) NSString *subAdministrativeArea; // county, eg. Santa Clara
@property (nonatomic, readonly) NSString *postalCode; // zip code, eg. 95014
@property (nonatomic, readonly) NSString *ISOcountryCode; // eg. US
@property (nonatomic, readonly) NSString *country; // eg. United States
@property (nonatomic, readonly) NSString *inlandWater; // eg. Lake Tahoe
@property (nonatomic, readonly) NSString *ocean; // eg. Pacific Ocean
@property (nonatomic, readonly) NSArray *areasOfInterest; // eg. Golden Gate Park
iOS 使用CLGeocoder获取地理位置的更多相关文章
- iOS8 CLLocationManager 、CLGeocoder获取地理位置
最近在ios8.0使用CLLocationManager定位服务,发现老不能定位,查看设置菜单中的项也是处于未知状态.想起之前都有一个弹出框提示用户是否允许定位,这次一直没有出现了.原来ios8.0下 ...
- 关于iOS开发首次进入需要获取地理位置
今天给大家简单介绍一下iOS开发过程中会遇到的获取地理位置的问题,(话不多说进入正题)这里给大家讲解一下两种在APPdelegate获取地理位置的方法: 一:首先是用系统的方法获取地理位置: 1. 首 ...
- HTML5 获取地理位置信息
HTML5增加的新功能,获取地理位置信息,如果浏览器支持且设备有定位功能,就能够直接使用这组API来获取当前信息位置.该Geolocation API可以应用于移动设备中的地理位置. Geolocat ...
- IOS百度地图获取所在的城市名称
笔者的app要实现定位所在省和城市名称,借此总结巩固一下! @interface VenueListVC : BasePageTableViewVC<BMKLocationServiceDele ...
- HTML5获取地理位置
包含了以下功能:(1)通过IP地址获取城市地址(并不完全准确,存在代理IP或IP中转时定位与实际位置不一致的情况)(2)通过移动端浏览器及GPS定位位置坐标(3)根据位置坐标转换百度地图坐标(4)根据 ...
- iOS根据Url 获取图片尺寸
iOS根据Url 获取图片尺寸 // 根据图片url获取图片尺寸 +(CGSize)getImageSizeWithURL:(id)imageURL { NSURL* URL = nil; if([i ...
- html5代码,获取地理位置
<!DOCTYPE html> <html> <head> <meta charset="utf-8"/> <meta htt ...
- paip.获取地理位置根据Ip
paip.获取地理位置根据Ip html转换txt 正则表达式截取mid 作者Attilax 艾龙, EMAIL:1466519819@qq.com 来源:attilax的专栏 地址:http:// ...
- Html5 Geolocation获取地理位置信息
Html5中提供了地理位置信息的API,通过浏览器来获取用户当前位置.基于此特性可以开发基于位置的服务应用.在获取地理位置信息前,首先浏览器都会向用户询问是否愿意共享其位置信息,待用户同意后才能使用. ...
随机推荐
- 新增tab页无法获取到数据,原来是URL的rewrite配置文件忘了修改
昨天怎么也不明白为什么就是不能短网址访问,而且更迷惑的是居然数据也获取不到. 今天早上在网上搜ThinkPHP,想学习下这个框架.虽然知道是MVC模式,但是URL数据传递到底有什么阀门是我尚未了解到的 ...
- 进程间通信(IPC) 简介
IPC是进程间通信的简称.传统上该术语描述的是运行在某个操作系统之上的不同进程间消息传递的不同方式. 我们讨论分为四个领域: 消息传递(管道,FIFO,消息队列(system v消息队列,posix消 ...
- easyui源码翻译1.32--Resizable(调整大小)
前言 使用$.fn.resizable.defaults重写默认值对象 下载该插件翻译源码 源码 /** * jQuery EasyUI 1.3.2 * *翻译:qq 1364386878 Resiz ...
- ANDROID_MARS学习笔记_S01原始版_008_Handler(异步消息处理机制)
一.流程 1.点击按钮,则代码会使handler把updateThread压到队列里去,从而执行updateThread的run() 2.run()里会通过msg.arg1 = i 和bundle来写 ...
- android usb host 读写USB设备
自android3.1以后android增加了操作USB设备的API. 官网地址:http://developer.android.com/guide/topics/connectivity/usb/ ...
- ALT+数字,可输入汉字或拉丁字母 good
各种编码查询表:http://bm.kdd.cc/ 输入 ALT + 50385 就出 难 字了,原因是它的十六进制ANSI编码是C4D1=50385 同理: 汉=BABA=47802字=D7D6=5 ...
- 让动画不再僵硬:Facebook Rebound Android动画库介绍
introduction official site:http://facebook.github.io/reboundgithub : https://github.com/facebook/reb ...
- php stdClass Object 问题
Array ( [0] => stdClass Object ( [term_id] => 3 [name] => apache [slug] => apache [term_ ...
- x+2y+3z=n的非负整数解数
题目:给一个正整数n,范围是[1,10^6],对于方程:x+2y+3z = n,其中x,y,z为非负整数,求有多少个这样的三元组 (x,y,z)满足此等式. 分析:先看x+2y=m,很明显这个等式的非 ...
- Hello Indigo
Windows Communication Foundation (WCF),formerly code-named “Indigo,” is Microsoft’s platform for Ser ...