开发者

What's the maximum number of regions that can be monitored on iPhone?

开发者 https://www.devze.com 2023-01-10 00:42 出处:网络
Any one know what\'s the maximum number of shared regions is? Do you get regionMonitoringDidFail call if you exceed it?

Any one know what's the maximum number of shared regions is? Do you get regionMonitoringDidFail call if you exceed it?

http://developer.apple.com/iphone/library/documentation/CoreLoca开发者_运维问答tion/Reference/CLLocationManager_Class/CLLocationManager/CLLocationManager.html#//apple_ref/occ/instp/CLLocationManager/monitoredRegions


I can't get it to accept more than 10 regions. No error message just monitoredRegions does not get any members after 10.

edit: if I add a lot (around 60) of regions sometimes it crashes. No error message. This produces a bad access

[locationManager startMonitoringForRegion:clr desiredAccuracy:500.0];

edit: at 5 regions I am getting pretty reliable results


I have the same experience. Here are a few tips:

  1. You need to check @selector(locationManager:monitoringDidFailForRegion:withError:) in delegate at each time.
  2. Keep the radius smaller than maximumRegionMonitoringDistance.
0

精彩评论

暂无评论...
验证码 换一张
取 消