我正在使用它,但我不知道如何监控超过 20 个区域,因为它在 ios 中的最大区域数可以监控
if ([AllRegionsArray count] > 0) {
for (int i = 0; i < [AllRegionsArray count]; i++) {
NSArray *LongLati = [AllRegionsArray objectAtIndex:i];
lutiuid = [LongLati objectAtIndex:0];
Longtuid = [LongLati objectAtIndex:1];
CLLocationCoordinate2D centreLoc = {[lutiuid floatValue], [Longtuid floatValue]};
CLLocationDistance regionRadius = 150.00;
CLRegion *grRegion = [[CLRegion alloc] initCircularRegionWithCenter:centreLoc radius:regionRadius identifier:[NSString stringWithFormat:@"grRegion%i",i]];
[locationManager startMonitoringForRegion:grRegion desiredAccuracy:acc];
NSLog(@"Mon = %i , %i",[locationManager.monitoredRegions count],i);
}
}