我在打电话CLLocationManager
,它也在调用它的委托方法。但我的问题是,行驶 1 公里后没有更新其新位置。
这是我的代码:
locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationTimer=[NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(updateLocation1:) userInfo:nil repeats:YES];
locationManager.distanceFilter = kCLDistanceFilterNone;
locationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation;
// Method did update location - Update location when location change
-(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
{
// this method is calling after every 1 sec interval time..
}
-(void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
// this method is not calling once also after travelling around a km ....
}
我究竟做错了什么?