Being a MapView Delegate

When Whereami launches, we want it to find the current location and display it on a map. In the last chapter, you worked directly with Core Location to find the user’s location. Now this won’t be necessary because an instance of MKMapView knows how to use Core Location to find the user’s location. All you have to do is set the showsUserLocation property of an MKMapView to YES, and it will find and show the user’s location on the map.

After the interface loads, the WhereamiViewController is sent the message viewDidLoad. This is when you will tell the MKMapView to update its location. (We’ll talk about viewDidLoad in detail in Chapter 7.) Implement this method in WhereamiViewController.m.

 -​ ​(​v​o​i​d​)​v​i​e​w​D​i​d​L​o​a​d​ ...

Get iOS Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.