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

Get Xcode 4 Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.