views:

42

answers:

1

how to get current latitude & longitude without

  • (void)locationManager:(CLLocationManager )manager didUpdateToLocation:(CLLocation)newLocation fromLocation:(CLLocation *)oldLocation {..}

using this method

and if i used this function , how much distance i have to travel.... to call this function or can i call this function programmatic ....

+1  A: 

The CLLocationManager is the interface you must use in order to get information about the location of the device.

You can initialise and begin getting location updates whenever you like. The CLLocationManager will notify your delegate whenever a new location is received.

locationManager = [[CLLocationManager alloc] init]; 
locationManager.desiredAccuracy = kCLLocationAccuracyBest; 
locationManager.distanceFilter = DISTANCE_FILTER_VALUE;
locationManager.delegate = self; 
[locationManager startUpdatingLocation];
Mr. Matt