I am using the following code in the viewDidLoad method
CLLocationManager *locationManager = [[CLLocationManager alloc] init]; locationManager.delegate = self; locationManager.distanceFilter = kCLDistanceFilterNone;
Then the method below is called continuously when the location changes.
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
But I want the current geo-points to be only once. Is there any method that gives you direct current geo-points? I want to calculate the distance between current geographic points and another location when I click the button. please help me if anyone knows.
source share