如何才能知道iphone中重要位置更新的准确性水平?作为标准位置,可以根据可以设置的参数来设置精度级别,但是不能为精度设置重要的位置精度,但是如何读取接收到的位置更新的精度?
发布于 2013-01-06 14:28:17
CLLocationManager类有一个名为desiredAccuracy的精度参数,它属于CLLocationAccuracy类。但是等一下!它不是一个类,它是一个typedef double,所以这里是常量
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;我建议你做的是将你的位置管理器的精度赋给一个新的变量it,并像下面这样比较它:
CLLocationAccuracy locationAccuracy = self.locationManager.desiredAccuracy;
if (locationAccuracy == kCLLocationAccuracyBest) {
    NSLog(@"It is the kCLLocationAccuracyBest my life is complete!");
}
else if (/*other comparisons stuff here*/) {
}此外,您还必须导入:
#import <CoreLocation/CLLocation.h>罗翰
https://stackoverflow.com/questions/14179854
复制相似问题