how to get old location from corelocation

China☆狼群 提交于 2019-12-25 02:06:51

问题


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

locations array last object holds new location, How to get the previous location?


回答1:


You should create and use a mutable array of previous locations that were updated from previous calls to "locationManager: didUpdateLocations:".

According to the Apple documentation, the only time that "locations" array passed in via the delegate method will have more than one entry will be "If update events were deferred or if multiple events arrived before they could be delivered, the array may contain additional entries."



来源:https://stackoverflow.com/questions/16261463/how-to-get-old-location-from-corelocation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!