如何知道iPhone中重要位置更新的准确度?作为标准位置,可以根据可以设置的参数设置精度等级,但是不能设置显着的位置精度以获得准确性,而是如何读取接收到的位置更新的准确度?
答案 0 :(得分:1)
班级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;
我建议您将位置管理员的准确性分配给新变量并将其与以下内容进行比较:
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>
罗汉