iphone startMonitoringRegion 受监控区域大小限制
我们可以监控的区域数量有限制吗? MonitoredRegions 是一个 NSSet,但没有硬限制规范。
谢谢!
is there a limit to the number of regions we can monitor?
monitoredRegions is a NSSet, but no specs on a hard limit.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我无法从 Apple 找到您可以同时监控的区域数量的具体数字。该文档称,如果需要为更新的当前区域腾出空间,您的区域可能会被推出。所有被监控的区域都进入操作系统的一个池中,因此 10 个来自您,10 个来自另一个应用程序......都是一样的。
如果您想确保您的区域仍然处于活动状态,您可以使用 -monitoredRegions 拉取应用程序的所有区域并循环遍历它们。如果您缺少一个,请将其添加回来。好问题。
I have been unable to find a specific number from Apple for number of regions you can monitor at once. The documentation says that your regions may get pushed out if it needs to make room for newer more current regions. All regions being monitored go into one pool for the OS, so 10 from you, 10 from another app... it's all the same.
If you want to ensure your regions are still active, you can pull in all the regions for your app using -monitoredRegions and loop through them. If you are missing one, add it back in. Good question.