0

我为事件做了一个观察者,在为事件UIApplicationWillTerminateNotification调用的方法中,我从位置管理器中删除了受监控的区域:

for (CLRegion *region in locationManagerInstance.monitoredRegions) {
        [locationManagerInstance stopMonitoringForRegion:region];
}

通常是好的监控区域被删除,当应用程序启动时我检查是否有一些监控区域:

[locationManagerInstance.monitoredRegions count]

但是在我的位置位于受监控区域之一的情况下,当应用程序终止时,区域不会被正确删除,并且在应用程序开始时受监控区域计数([locationManagerInstance.monitoredRegions count])大于 0。

应用程序终止时如何正确删除区域?

4

0 回答 0