title: How to add more than one color pin to a mapview.
body: <p>I have a map that has 3 categories of points of interest. At the moment I have got them to display however they are all the same color. How can I get them to display a color depending to what category they are in? </p>
  
  <p>I have had a search around and couldn't find anything that I could understand to apply to my code.</p>
  
  <p>Here is my current code for annotating the pins:</p>
  
  <pre><code>-(void)pins:(NSString *)name lat:(NSString *)lat lon:(NSString *)lon poiID:(NSString *)poiID
  {
  
      //cast string to float
      CGFloat Lat = (CGFloat)[lat floatValue];
      CGFloat Lon = (CGFloat)[lon floatValue];
  
      //Set coordinates of pin
      CLLocationCoordinate2D coordinate;
      coordinate.latitude = Lat;
      coordinate.longitude = Lon;
  
      //Create Pin
      MKPointAnnotation *annotation = [[MKPointAnnotation alloc] init];
      //set details
      [annotation setCoordinate:coordinate];
      [annotation setTitle:name];
      [annotation setAccessibilityLabel:poiID]; //set the label eq to the id so we know which poi page to go to
  
  
      // Add pin to map
      [self.showMapView addAnnotation:annotation];
  }
  
  - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id &lt;MKAnnotation&gt;)annotation {
      //create annotation
      MKPinAnnotationView *pinView = (MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:@"pinView"];
      if (!pinView) {
          pinView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"pinView"];
          pinView.pinColor = MKPinAnnotationColorRed;
          pinView.animatesDrop = FALSE;
          pinView.canShowCallout = YES;
  
          //details button
          UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
          pinView.rightCalloutAccessoryView = rightButton;
  
      } else {
          pinView.annotation = annotation;
      }
      return pinView;
  }
  </code></pre>
  
  <p>Here is the rest of my <a href="http://pastebin.com/sxAmutVr" rel="nofollow">Code</a> incase it is needed. </p>
  
  <p>Thanks for any help. </p>