为了节省电量,我监控位置更新以查看用户是否已静止一段时间;如果是这样,我然后将CLLocationManager从其主要设置kCLLocationAccuracyBestForNavigation和kCLDistanceFilterNone(最大设置)降级到仅监视重大位置更改。核心位置:切换启动监控重要位置从kCLDistanceFilterNone更改为
问题是,它不起作用:在调用startMonitoringSignificantLocationChanges之后,位置更新继续像调用之前一样以高速率涌入。
你如何看待活动,然后再次备份?
更新:此代码回答了这个问题:
//Set
if (shouldMonitorSignificantChangeUpdates) {
NSLog(@"Entering -> significant change mode");
[self.locationManager stopUpdatingLocation];
[self.locationManager startMonitoringSignificantLocationChanges]; //aka stop monitoring every location change
} else {
NSLog(@"Exiting <- significant change mode");
[self.locationManager stopMonitoringSignificantLocationChanges]; //aka begin monitoring every location change
[self.locationManager startUpdatingLocation];
}
你是如何测试的?通过文件设备通过检测小区塔ID(GSM)的变化来判定存在显着的位置变化。退房还http://stackoverflow.com/questions/8290707/startmonitoringsignificantlocationchanges-lack-of-准确 – 2012-03-04 08:18:05
是的,似乎我不允许塔改变,所以从来没有更新,错误地假设整个系统是禁用。 – SG1 2012-03-04 16:41:07