Can anyone suggest a reason, other than didactic, to use CoreLocation in the map annotation exercise?
As far as I can tell the findLocation and foundLocation methods, to use locationManager to find the user location, aren’t necessary. In the textFieldShouldReturn method, instead of sending the findLocation message,
add the annotation directly since the user location is in the userLocation property of worldView. The user is, after all, entering an annotation label on a map already zoomed to the current location so the locationManager finds the user location essentially instantly – hence the activity animation and text field hiding aren’t even perceptible and since the zoom level doesn’t change that result of foundLocation isn’t visible.
I see the educational point of coding extra methods for some asynchronous event like finding the user location. The activity animation and field hiding are interesting and good to learn. But since it seems unnecessary to me in this case I initially found it quite confusing.
Why was I doing this?
Perhaps I didn’t’ figure out that it wasn’t necessary – perhaps I just don’t understand why it is necessary – or at any rate a good idea.