3

我的问题是关于从#CLLocation 管理器获取多个位置以及如何在目标 C 中制作 x 和 y 轴。

4

1 回答 1

1

存储在委托方法中的所有位置:

- (void)locationManager:(CLLocationManager *)manager 
    didUpdateToLocation:(CLLocation *)newLocation 
           fromLocation:(CLLocation *)oldLocation

上面的委托在 iOS 6 中已被弃用。现在应该使用以下内容:

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

为了获取最后一个位置,只需获取数组的最后一个对象:

[locations lastObject]
于 2017-07-20T12:57:07.377 回答