MKReverseGeocoder 获取地址的详细信息

本文详细介绍了如何通过MKReverseGeocoder获取地理位置信息,并解析MKPlacemark对象中的具体属性,包括街道名称、门牌号、城市等,帮助开发者更好地理解iOS地图组件的位置数据。
- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark
{
NSLog(@"%@",placemark.locality);
}
//=======================================================
Street = 科韵路 18号
Thoroughfare = 科韵路
SubThoroughfare = 18号
City = 广州市
SubLocality = 天河区
State = 广东省
SubAdministrativeArea = (null)
ZIP = (null)
Country = 中国
{
City = "广州市";
Country = "中国";
CountryCode = CN;
FormattedAddressLines = (
"中国",
"广东省广州市天河区",
"科韵路18号"
);
State = "广东省";
Street = "科韵路18号";
SubLocality = "天河区";
SubThoroughfare = "18号";
Thoroughfare = "科韵路";
}
MKPlacemark:
@property (nonatomic, readonly) NSDictionary *addressDictionary; //地址字典
@property (nonatomic, readonly) NSString *thoroughfare; //街道名——“科韵路”
@property (nonatomic, readonly) NSString *subThoroughfare; // 门牌号——“18号”
@property (nonatomic, readonly) NSString *locality; //城市——“广州市”
@property (nonatomic, readonly) NSString *subLocality; //区县——“天河区”
@property (nonatomic, readonly) NSString *administrativeArea; //身份——“广东省”
@property (nonatomic, readonly) NSString *subAdministrativeArea; //没获取到,不知道是什么东东
@property (nonatomic, readonly) NSString *postalCode; //邮政编码——不知道是什么原因,这里没获取到
@property (nonatomic, readonly) NSString *country; //国家——“中国”
@property (nonatomic, readonly) NSString *countryCode; //国家代码——“CN”

转载于:https://www.cnblogs.com/solitary/archive/2012/11/02/2751304.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值