CLLocationManager的区域监控与重要的位置变化

时间:2012-03-04 20:51:45

标签: ios location cllocationmanager monitor region

在文档中,不清楚区域监控是如何实现的。它纯粹基于重要的位置变化,还是重要的位置变更和标准位置服务的混合?

2 个答案:

答案 0 :(得分:1)

根据经验,我会说它使用重要的位置更改,直到它足够接近必须使用更具体的位置更新,但我没有数据来证明它。我唯一确定的是,它的工作原理太准确,不仅仅是重要的位置变化,而且似乎没有耗尽电池,所以我认为它不会经常使用更精确的位置更新。

答案 1 :(得分:0)

Ya区域监控在IOS 4.0和后续设备之后启动,它也在应用程序终止时工作或理想模式意味着它不依赖于应用程序服务它是依赖于ios的服务,如本地通知您找到您的位置或给出某个位置坐标到特定给定距离后的regin和设置区域监控它的enterin区域和exitRegion方法在这些函数中调用你做你的wirk

设置区域

CLLocationDistance dist=200.0;
    CLRegion *region = [[CLRegion alloc]initCircularRegionWithCenter:coord radius:dist identifier:@"Test"];
    if([CLLocationManager regionMonitoringEnabled] && [CLLocationManager regionMonitoringAvailable])
        [locationManager startMonitoringForRegion:region desiredAccuracy:kCLLocationAccuracyBest];

-(void)locationManager:(CLLocationManager *)manager didExitRegion:(CLRegion *)region
{

}

-(void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region
{

}
相关问题