iPhone current user location coordinates showing as (0,0)

The map will not try to get the users location until it’s actually displayed, as far as I know. A good test of that is, when do you get the dialog asking you if it’s OK for the app to get the users location? In my experience that has always come up only after the map shows on screen.

The best way to approach this problem if you must have a location on startup, is to implement the classic Core Location handler code and get the location from that initially. You can stop receiving updates from there once the map is up and get further changes from there (though if you need constant updates you are better off just keeping with the standard Core Location updates. If you think about it, when you have “shows user location” enabled in the map further use of Core Location by your app is essentially free since the GPS will be fired up the whole time anyway.

Leave a Comment