How to get current geo points only once in iphone?

cllocationmanager, iphone

Solution

In `- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation` you can call

[manager stopUpdatingLocation];

Problem

I am using following code in viewDidLoad method ``` CLLocationManager *locationManager = [[CLLocationManager alloc] init]; locationManager.delegate = self; locationManager.distanceFilter = kCLDistanceFilterNone; // whenever we move locationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation; [locationManager startUpdatingLocation]; ``` Then below method is called continuously when location changed. ``` - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation ``` But I want current geo points only once. Is there any method which gives you directly current geo points? I want to calculate distance between current geo points and other location when I click some button. please help me if any one knows.

Original source