fuzzygoat
fuzzygoat

Reputation: 26223

One off request for location?

Is there a way using CLLocationManager to ask for a one off location, the equivalent of saying "when I press this button, tell me where I am" or is it just a case of calling

[locationManager startUpdatingLocation];
// and implementing: locationManager:didUpdateToLocation:fromLocation:
[locationManager stopUpdatingLocation];

Upvotes: 1

Views: 190

Answers (1)

Robert Höglund
Robert Höglund

Reputation: 10090

Short answer: no.

It can take some time to get a location which is why the CLLocationManager uses a delegate. You have to call stopUpdating location in the callback locationManager:didUpdateToLocation:fromLocation:.

Upvotes: 2

Related Questions