how to get old location from corelocation

2019-08-20 07:37发布

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

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

1条回答
聊天终结者
2楼-- · 2019-08-20 08:02

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."

查看更多
登录 后发表回答