O'Reilly logo

iOS Programming: The Big Nerd Ranch Guide by Joe Conway, Aaron Hillegass

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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​ ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required