didUpdateLocations和didUpdateToLocation

时间:2013-08-23 17:54:21

标签: ios location

支持iOS 5和6,应该从didUpdateLocations拨打didUpdateToLocation

如何进行调用并构建Locations数组?请问任何代码示例?

谢谢。

2 个答案:

答案 0 :(得分:1)

您不会调用这些例程。系统CoreLocation专门调用它们。

答案 1 :(得分:0)

我认为这个确切的代码会显示在WWDC 2012会话中,Staying on Track with Location Services

- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
    [self locationManager:manager didUpdateLocations:@[newLocation]];
}

-(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
{
    // your location handling code
 }