O'Reilly logo

Xcode 4 Cookbook by Steven F. Daniel

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

Adding annotation placeholders to the map

In this recipe we will learn how to create our own custom class that will enable us to add annotations to our map view control.

Getting ready

In this section we will see how we can use the MKAnnotation and MKAnnotationView classes to enable us to apply a series of annotation pins based on the geographic latitude and longitude values to our mapView control.

How to do it…

To begin, follow these simple steps as outlined in the following order:

  1. Select the CoreLocation group, choose File | New | File… or press Command + N.
  2. Select the Objective-C class template from the list of available templates.
  3. Click on the Next button to proceed to the next step in the wizard.
  4. Enter in MapViewAnnotation as the name of the class ...

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