0

I made an observer for the event UIApplicationWillTerminateNotification and in the method which is called for the event I remove monitored regions from Location manager:

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

normally is ok monitored regions are removed, when the app start I check if there are some monitored regions:

[locationManagerInstance.monitoredRegions count]

but in the case when my location is in one of monitored region, then regions are not removed properly when application is terminated, and in the start of app monitored regions count ([locationManagerInstance.monitoredRegions count]) is bigger than 0.

How can I remove properly regions when application is terminated?

jopasserat
  • 5,721
  • 4
  • 31
  • 50
Adam Popławski
  • 345
  • 1
  • 3
  • 13

0 Answers0