I have an ap开发者_如何学运维plication that is linking to a static library. Inside of the static library, there's a CLLocationManager that is in charge of getting the device's coordinates, however, I'm noticing some strange behavior. Once the application is completely exited (no longer backgrounding), the compass icon stays in the status bar. I believe since the compass icon is remaining in the status bar, the device's GPS radio is still on, polling for the device's location.
Once I remove my application from the device, the icon disappears. Is this a bug?
Do you know what's going on in the library?
The behavior would be normal if the significant location update service or the region monitoring service are used. These services actually cause your app to be started in the background (if it's not already in suspended state) when an event is received.
Update: Be aware that the Core Location icon stays in the status bar when you're going to the background while debugging the app in Xcode. Reason being your app doesn't get suspended while a debug session is active.
精彩评论