CLGeocoder 和向后兼容性
我有一个简单的问题。
MKReverseCoder
已弃用,自 iOS 5 起不再工作。我们必须使用CLGeocoder
。但是,iOS4下有很多人。新应用程序如何与iOS4和iOS5配合进行地理编码?
谢谢!
I have a simple question.
MKReverseCoder
is deprecated and doesn't work since iOS 5. We have to use CLGeocoder
. But, there are a lot of people under iOS4. How the new apps can work with iOS4 and iOS5 for geocoding ?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果有人试图从 MKReverseGeocoder 转移到 CLGeocoder,那么我写了一篇博客文章,可能会有帮助 http://jonathanfield.me/jons-blog/clgeocoder-example.html
基本上一个例子是,在创建 locationManager 和 CLGeocoder 对象后,只需将此代码添加到您的
viewDidLoad()
然后制作一些标签或文本区域来显示数据。If anyone is trying to move onto CLGeocoder from MKReverseGeocoder then I have written a blog post that might be of help http://jonathanfield.me/jons-blog/clgeocoder-example.html
Basically an example would be, after you have created locationManager and CLGeocoder objects just add this code to your
viewDidLoad()
and then make some labels or text areas to show the data.MKReverseGeocoder
仍然适用于 iOS5。它只是被弃用了,这意味着它会在稍后的某个时候被删除(比如在 iOS6 之类的版本发布时)。所以您现在可以继续使用它,没有任何问题MKReverseGeocoder
still works with iOS5. It's just deprecated, which means it'll be removed at some later point (like at the release of something like iOS6). So you can continue to use it now without any issues有关详细信息,请参阅CLPlacemark 的属性
For more see property of CLPlacemark