- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用它,但我不知道如何监控超过 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);
}
}
最佳答案
您无法监控超过 20 个区域。也许您可以根据用户位置停止监视某些区域并开始监视其他区域(取决于您的用例)。
Discussion You must call this method once for each region you want to monitor. If an existing region with the same identifier is already being monitored by the application, the old region is replaced by the new one. The regions you add using this method are shared by all location manager objects in your application and stored in the monitoredRegions property.
Region events are delivered to the locationManager:didEnterRegion: and locationManager:didExitRegion: methods of your delegate. If there is an error, the location manager calls the locationManager:monitoringDidFailForRegion:withError: method of your delegate instead.
An app can register up to 20 regions at a time. In order to report region changes in a timely manner, the region monitoring service requires network connectivity.
In iOS 6, regions with a radius between 1 and 400 meters work better on iPhone 4S or later devices. (In iOS 5, regions with a radius between 1 and 150 meters work better on iPhone 4S and later devices.) On these devices, an app can expect to receive the appropriate region entered or region exited notification within 3 to 5 minutes on average, if not sooner.
关于ios - 如何为超过 20 个区域启动 MonitoringForRegion,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17088728/
我是一名优秀的程序员,十分优秀!