title: MKMapView: Instead of Annotation Pin, a custom view
body: <p>I want to display an image in my <code>MKMapView</code> instead of little <em>rock pin</em>.</p>
  
  <p>Can someone please put some helpful code here, or tell the way how to do it?</p>
  
  <pre><code>-(MKAnnotationView *)mapView:(MKMapView *)mV viewForAnnotation:
      (id &lt;MKAnnotation&gt;)annotation {
      MKPinAnnotationView *pinView = nil; 
      if(annotation != mapView.userLocation) 
      {
          static NSString *defaultPinID = @"com.invasivecode.pin";
          pinView = (MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:defaultPinID];
          if ( pinView == nil ) pinView = [[MKPinAnnotationView alloc]
                                            initWithAnnotation:annotation reuseIdentifier:defaultPinID];
  
          pinView.pinColor = MKPinAnnotationColorGreen; 
          pinView.canShowCallout = YES;
          pinView.animatesDrop = YES;
          pinView.image = [UIImage imageNamed:@"pinks.jpg"]; //as suggested by Squatch
      } 
      else {
          [mapView.userLocation setTitle:@"I am here"];
      }
      return pinView;
  }
  </code></pre>
  
  <p>I am expecting my image <em>pinks.jpg</em> to be on the map, pinning the location instead of default pin view (<em>rock pin shaped</em>). But still I am getting the default image of the pin.</p>