iphone 获取地址的详细信息
2010-12-30 04:38:28 来源:WEB开发网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; //地址字典
- ››iPhone应用帮助残障儿童看图说话
- ››iPhone实用工具AppBox Pro使用教程大揭秘
- ››iphone4省电方法
- ››iphone 获取地址的详细信息
- ››iPhone 库的基本内存管理策略
- ››iPhone加密文字亲手做 私密信息有保障
- ››iphone 根据经纬度坐标取详细地址(包括国,省,市...
- ››iphone/ipad ios cocoa object-c 近期苹果UI部分小...
- ››iphone中如何进行多线程编程
- ››iPhone OS SDK的这些事[安装、下载、版本、实例、...
- ››iPhone ObjectC的NSAutoreleasePool
- ››iPhone 判断设备是在Portrait(纵向)还是(Landscap...
更多精彩
赞助商链接