When I have location services disabled, this alert shows up twice. The first time is without the location manager purpose property displayed. Immediately after that (before a button of first alert is touched), it shows again, this time with the purpose property included.
When the second alert is dismissed, the first alert is still there.
This is a little annoying, and I would expect it to be confusing to the users.
What can I do to only show it once, with the purpose property?
I had both a map controller object and a location manager object instantiated in my app delegate.
However, the location manager purpose property is not set until the location manager is instantiated in this code:
So this was a clue that something in the initialization of the map was triggering the first alert.
Because I declined to turn location services on in the first alert, the map controller initialized and saw a need to show the alert. The map controller initialization is this (it is part of a singleton, and needs some cleanup in that regard, but ignoring that…):
Stepping through the code, I saw the second alert show up when the
showUserLocationline was executed. I’ll have to do a little more testing to narrow it down exactly, but I think I’m on the right track now.