位置经理提供的最新价值 [英] What location manager is offering as its recent value

查看:50
本文介绍了位置经理提供的最新价值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

这篇关于位置经理提供的最新价值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆