Search code examples
iosobjective-cparse-platformcllocationmanager

How to stop updating location once I get current location?


I'm using Parse and with geoPointForCurrentLocationInBackground I can stop updating once a location is received without having to manually stop it.

How do I stop updating location immediately right after I receive location using CLLocationManager?

Edit

I know [self.locationManager stopUpdatingLocation]; stops it. What I'm really asking is, how do I know I've received location for the first time then stop it immediately?


Solution

  • After getting your location, use this method:

    [self.locationManager stopUpdatingLocation];
    self.locationManager = nil;