CLLocationManager Or MKMapView


#1

Ok finally I had time to finish the chapter 5. The app works, but I still have a question.
Once MKMapView call the “didUpdateUserLocation” delegate we get the new location, then I don’t see why we need the CLLocationManager to find the location again.
We could define a global CLLocationCoordinate2D variable to save the location from “didUpdateUserLocation”, and then use it wen the user decide to tag the location.

I have test it, and it works.

So to back on my question, why do we need to use CLLocationaManager ?

ciao


#2

As a iOS newbie, my general understanding for this project is that once the user has hit “Done” button for the text field, we want the app to do an immediate update on the user’s location (cause it might have changed from previous?) before the app adds the annotation, and that’s where CLLocationManager comes into play.

Anyone can verify this?


#3

Yes, the user location could be lagging behind, but in reality, we’re just trying to teach the concepts of delegation and the bits and pieces that make up an application. Sometimes, we do a little extra work to get to the right solution so we can touch on a number of different techniques - this is one of those cases.