I have a program with a location manager set up like this:
self.locationManager = [[CLLocationManager alloc] init];
[locationManager startUpdatingLocation];
locationManager.delegate = self;
locationManager.distanceFilter = kCLDistanceFilterNone;
locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters;
I need the accuracy to within ten meters, however, it takes a few calls of the didUpdateToLocation delegate method to find the location at that accuracy. How would I go about delaying the call of this method or just indicate when the desired accuracy is achieved in order to proceed with the program.
Right now it tries proceeds with the first location returned. Even the second location update is not as accurate as expected.
Thanks in advance!
Since each delegate call includes an accuracy figure, simply return from the method until your desired accuracy is reached (warning: that may never happen).
You can’t simply jump to a ten meter result – there’s a reason why it’s called “desired” accuracy and not mandatory accuracy. You have to give it time to calculate more exact positions.