title: App crashes due to 'NSInvalidArgumentException', reason: '-[MKAnnotationView setPinColor:]
body: <p>My code for annotation is:</p>
  
  <pre><code>- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id&lt;MKAnnotation&gt;)annotation {
      static NSString *identifier = @"RoutePinAnnotation";
  
      if ([annotation isKindOfClass:[UICRouteAnnotation class]]&amp;&amp;[(UICRouteAnnotation *)annotation annotationType] != UICRouteAnnotationTypeWayPoint) 
      {
  
          MKPinAnnotationView *pinAnnotation = (MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:identifier];
          if(!pinAnnotation) {
              pinAnnotation = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:identifier] autorelease];
          }
  
          if ([(UICRouteAnnotation *)annotation annotationType] == UICRouteAnnotationTypeStart) {
  
              pinAnnotation.pinColor = MKPinAnnotationColorGreen;
  
  
          } else if ([(UICRouteAnnotation *)annotation annotationType] == UICRouteAnnotationTypeEnd) {
              pinAnnotation.pinColor = MKPinAnnotationColorRed;
  
          }
          pinAnnotation.animatesDrop = YES;
          pinAnnotation.enabled = YES;
          pinAnnotation.canShowCallout = YES;
          return pinAnnotation;
      }
  
  
  
  
  
  }
  </code></pre>
  
  <p>App runs fine first but when we zoom the map it crashes.
  Terminating app due to uncaught exception <strong>NSInvalidArgumentException</strong>, reason: <code>-[MKAnnotationView setPinColor:]</code><br>
  Please help me!! Thanks</p>