MKReverseGeocoder:位置字符串存储在哪里?

发布于 2024-10-31 21:52:34 字数 768 浏览 0 评论 0原文

我找到了这个教程:

http://evilrockhopper.com/2010/01/ iphone-development-reverse-geocoding/

并实现了这段代码:

if (reverseGeocoder != nil)
{
    // release the existing reverse geocoder to stop it running
    [reverseGeocoder release];
}

// use whatever lat / long values or CLLocationCoordinate2D you like here.
CLLocationCoordinate2D locationToLookup = {52.0,0};
MKReverseGeocoder *reverseGeocoder = [[MKReverseGeocoder alloc] initWithCoordinate:locationToLookup];
reverseGeocoder.delegate = self;
[reverseGeocoder start];

问题是,当我开始reverseGeocoding时,位置字符串存储在哪里? 我有坐标,我把它们交给reverseCeocoder来找到我的地址,但是如何在某个字符串中获取这个地址?

I found this tutorial:

http://evilrockhopper.com/2010/01/iphone-development-reverse-geocoding/

and implemented this code:

if (reverseGeocoder != nil)
{
    // release the existing reverse geocoder to stop it running
    [reverseGeocoder release];
}

// use whatever lat / long values or CLLocationCoordinate2D you like here.
CLLocationCoordinate2D locationToLookup = {52.0,0};
MKReverseGeocoder *reverseGeocoder = [[MKReverseGeocoder alloc] initWithCoordinate:locationToLookup];
reverseGeocoder.delegate = self;
[reverseGeocoder start];

The question is, when I started reverseGeocoding, where is location string stored?
I have coordinate and I give them to reverseCeocoder to find me address, but how to get this address in some string for example?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

画▽骨i 2024-11-07 21:52:34

只需阅读 MKReverseGeocoder 的文档:

反向地理编码器通过其关联的委托对象返回信息,该委托对象是符合 MKReverseGeocoderDelegate 协议的对象。

因此,您必须在委托中实现这两个方法:

– reverseGeocoder:didFindPlacemark:
– reverseGeocoder:didFailWithError:

地理编码器在为您提供信息时将调用它们。

Just read the documentation for MKReverseGeocoder:

The reverse geocoder returns information through its associated delegate object, which is an object that conforms to the MKReverseGeocoderDelegate protocol.

So you have to implement these two methods in your delegate:

– reverseGeocoder:didFindPlacemark:
– reverseGeocoder:didFailWithError:

and the geocoder will call them when it has information for you.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文