title: Accessing the "selected" property of custom MKAnnotationView?
body: <p>I'm trying to use the "selected" property in MKAnnotationView ( discussed <a href="http://developer.apple.com/iphone/library/documentation/MapKit/Reference/MKAnnotationView_Class/Reference/Reference.html#//apple_ref/occ/instp/MKAnnotationView/selected" rel="nofollow noreferrer">here</a> ), this is for the user to be able to delete a selected annotation... </p>
  
  <p>The following piece of code should find the selected pin in MKMapView and remove it:</p>
  
  <pre><code>CSMapAnnotation *a;
  
  for(a in [mapView annotations])
  {
      if([a selected]) //Warning: 'CSMapAnnotation' may not respond to '-selected'
      {
          [mapView removeAnnotation:a];
      }
  }
  </code></pre>
  
  <p>Where CSMapAnnotation is my Custom Map Annotation defined like this:</p>
  
  <pre><code>#import &lt;Foundation/Foundation.h&gt;
  #import &lt;MapKit/MapKit.h&gt;
  
  // types of annotations for which we will provide annotation views. 
  typedef enum {
      kCMapAnnotationTypeStart        = 0,
      kCMapAnnotationTypeCheckpoint   = 1,
      kCMapAnnotationTypeEnd          = 2
  } CSMapAnnotationType;
  
  @interface CSMapAnnotation : NSObject &lt;MKAnnotation&gt;
  {
      CLLocationCoordinate2D coordinate;
      CSMapAnnotationType    annotationType;
      NSString*              title;
      NSString*              userData;
  }
  
  -(id) initWithCoordinate:(CLLocationCoordinate2D)inCoordinate 
            annotationType:(CSMapAnnotationType) annotationType
                     title:(NSString*)title;
  
  - (BOOL) isEqualToAnnotation:(CSMapAnnotation *) anAnnotation;
  
  @property (nonatomic, readwrite) CLLocationCoordinate2D coordinate;
  @property (nonatomic, readwrite) CSMapAnnotationType    annotationType;
  @property (nonatomic, retain) NSString* title;
  @property (nonatomic, retain) NSString* userData;
  </code></pre>
  
  <p>I think that because I'm not really "inheriting" from <code>MKAnnotationView</code>, <code>CSMapAnnotation</code> will not respond to <code>selected</code>. </p>
  
  <p>What would be the best way to fix this issue ??</p>