Cover by Joe Conway, Aaron Hillegass

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

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

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required