开发学院手机开发iPhone 开发 iphone 获取地址的详细信息 阅读

iphone 获取地址的详细信息

 2010-12-30 04:38:28 来源:WEB开发网   
核心提示:首页完成改版,来提意见iphone获取地址的详细信息- (id)initWithCoordinate:(CLLocationCoordinate2D)coordinate {if (self = [super init]) {// Custom initializationreverseGeocoder = [[MKR
首页完成改版,来提意见

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; //地址字典

1 2  下一页

Tags:iphone 获取 地址

编辑录入:爽爽 [复制链接] [打 印]
[]
  • 好
  • 好的评价 如果觉得好,就请您
      0%(0)
  • 差
  • 差的评价 如果觉得差,就请您
      0%(0)
更多精彩
    赞助商链接

    热点阅读
      焦点图片
        最新推荐
          精彩阅读