Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在开发一个 Beacon iOS 应用程序。但是我面临一个问题。我发现当信标设备距离 iPhone 一定距离时,LocationManager:didEnterRegion和LocationManager:didExitRegion方法都会以随机方式重复调用。我究竟做错了什么?!
我不认为你做错了什么。如果您处于接收边缘,那么调用这些委托方法实际上是有道理的,并且它实际上可能看起来是随机的。如果你离信标更远,最后调用的委托方法应该是 didExitRegion: ,反之亦然。
您是否在进入/退出区域回调中的一个或两个中删除并重新添加了您正在监视的区域?如果是这样,请删除它们