首页 技术 正文
技术 2022年11月6日
0 收藏 427 点赞 468 浏览 1833 个字

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”;//街道名称

}

iOS 使用CLGeocoder获取地理位置

注意:上面的这个字典是可以直接转化为联系人的字典的,通过这个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

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,088
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,564
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,412
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,185
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,822
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,905