raghul
raghul

Reputation: 1048

How to Get the Accuracy of significant Location update in iphone?

How can one know of the accuracy level of the significant location update in iphone?? As the standard location, one can set the accuracy level depending upon the parameters that can be set, but whereas the significant location accuracy cannot be set for accuracy but how to read the accuracy of the received location update?

Upvotes: 1

Views: 924

Answers (1)

MCKapur
MCKapur

Reputation: 9157

The class CLLocationManager has an accuracy parameter, called desiredAccuracy which is of the class CLLocationAccuracy. But hold up! Its not a class, its a typedef double so here are the constants

extern const CLLocationAccuracy kCLLocationAccuracyBestForNavigation __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0);
extern const CLLocationAccuracy kCLLocationAccuracyBest;
extern const CLLocationAccuracy kCLLocationAccuracyNearestTenMeters;
extern const CLLocationAccuracy kCLLocationAccuracyHundredMeters;
extern const CLLocationAccuracy kCLLocationAccuracyKilometer;
extern const CLLocationAccuracy kCLLocationAccuracyThreeKilometers;

What I suggest you do is assign your location manager's accuracy to a new variable it and compare it like the following:

CLLocationAccuracy locationAccuracy = self.locationManager.desiredAccuracy;

if (locationAccuracy == kCLLocationAccuracyBest) {

    NSLog(@"It is the kCLLocationAccuracyBest my life is complete!");
}
else if (/*other comparisons stuff here*/) {

}

Also, you have to import:

#import <CoreLocation/CLLocation.h>

Rohan

Upvotes: 1

Related Questions