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 show the user’s location on the map.
At the end of application:didFinishLaunchingWithOptions:, replace the message that tells the locationManager to update its location with one that tells the MKMapView to show the current location.
- (BOOL)application:(UIApplication *)application ...
Get iOS Programming: The Big Nerd Ranch Guide, Second Edition 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.