简要咨询咨询QQ网站导航网站搜索手机站点联系我们设为首页加入收藏 

iphone 获取地址的详细信息

来源:易贤网   阅读:897 次  日期:2014-11-04 11:00:35

温馨提示:易贤网小编为您整理了“iphone 获取地址的详细信息”,方便广大网友查阅!

首页完成改版,来提意见

iphone获取地址的详细信息

- (id)initWithCoordinate:(CLLocationCoordinate2D)coordinate {

if (self = [super init]) {

// Custom initialization

reverseGeocoder = [[MKReverseGeocoder alloc] initWithCoordinate:coordinate];

reverseGeocoder.delegate = self;

[reverseGeocoder start];

//……

}

return self;

}

#pragma mark MKReverseGeocoderDelegate

- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFailWithError:(NSError *)error

{

NSString *errorMessage = [error localizedDescription];

UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"获取详细信息失败"

message:errorMessage

delegate:nil

cancelButtonTitle:@"OK"

otherButtonTitles:nil];

[alertView show];

[alertView release];

}

- (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”

更多信息请查看IT技术专栏

更多信息请查看技术文章
点此处就本文及相关问题在本站进行非正式的简要咨询(便捷快速)】     【点此处查询各地各类考试咨询QQ号码及交流群
上一篇:iOS中点击按钮修改文本的尺寸
下一篇:iPhone 库的基本内存管理策略
易贤网手机网站地址:iphone 获取地址的详细信息
由于各方面情况的不断调整与变化,易贤网提供的所有考试信息和咨询回复仅供参考,敬请考生以权威部门公布的正式信息和咨询为准!