I am using CLLocationManager in my application. I use the following code to initialize CLLocationManger.
self.locationManager = [[CLLocationManager alloc] init]; [self.locationManager setDelegate:self]; [self.locationManager setDesiredAccuracy:kCLLocationAccuracyBest]; [self.locationManager setDistanceFilter:10.0]; [self.locationManager startUpdatingLocation];
I set distanceFilter as 10.0 meters. Now I do not move my device (it is still in one place). but after that the delegate of CLLocationManger is automatically called.
- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations { NSLog(@"Locations : %@", locations); }
I want to get a new location if my device moves 10 meters, otherwise not.
So pls tell me how to use the distanceFilter property and get a new location.
source share