位置经理提供的最新价值

编程入门 行业动态 更新时间:2024-10-28 02:28:10
本文介绍了位置经理提供的最新价值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我问了一个有关如何从中获取旧位置的问题:

I asked a question regarding how to get old location from this:

- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations

我得到了回复

您应该创建并使用一个可变的先前位置数组,该位置是从先前对 locationManager: didUpdateLocations:的调用中更新的。 链接

现在,我对位置意识指南苹果说:

如果已经发送了位置更新,则还可以直接从CLLocationManager对象获取最近的位置数据,而不必等待新的事件传递。

If a location update has already been delivered, you can also get the most recent location data directly from the CLLocationManager object without waiting for a new event to be delivered.

我不明白这一点。请帮帮我。

I am not getting this point. Please help me out.

推荐答案

如果您查看有关CLLocationManager的Apple文档,您会看到它具有一个属性,您可以

If you look at Apple's documentation for CLLocationManager, you'll see it has a property you can access that's named "location".

此属性包含最近报告的位置数据。

This property contains the last reported location data.

每当新位置得到解决时,

And whenever new locations gets resolved & reported, that property should presumably be updated.

不过,通常来说,您将希望通过以下方式来使用户保持最新状态:委托方法。

In general though, you'll want to keep your users up-to-date on the current location via updates passed through the delegate methods.

更多推荐

位置经理提供的最新价值

本文发布于:2023-10-30 08:16:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1542287.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:位置   价值   经理   最新

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!