简体   繁体   中英

Does MapKit's startMonitoringForRegion save a reference of the region?

I have managed to get startMonitoringForRegion to work. It works as expected by notifying me when entering the specified regions.

As I was changing the identifier for the regions, I noticed that previous regions (with different identifiers) were still being monitored after rerunning the app.

Does anyone know if the app saves references to these regions so that you have to manually stop each region to be monitored?

Core Location monitoring is persistent.

I doubt if it saves a memory reference to the region you create, since the region is defined in your app's memory space and region monitoring can persist even when your app is not running at all.

The documentation explains how background region monitoring works. You should read up on it.

Whether or not regions are automatically removed from monitoring at a certain point, I want to stop monitoring all regions from previous runs of my app. For that I found the answer here: https://stackoverflow.com/a/11303480/6357591

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM