我问了一个有关如何从中获取旧位置的问题:
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.
更多推荐
位置经理提供的最新价值
发布评论