title: How to draw a MKPolyline on a MapView?
body: <p>I have an array of points to be drawn on a map, its already decoded:</p>
  
  <pre><code>- (void) drawRoute:(NSArray *) path {
      NSInteger numberOfSteps = path.count;
  
      CLLocationCoordinate2D coordinates[numberOfSteps];
      for (NSInteger index = 0; index &lt; numberOfSteps; index++) {
           CLLocation *location = [path objectAtIndex:index];
           CLLocationCoordinate2D coordinate = location.coordinate;
  
           coordinates[index] = coordinate;
      }
  
      MKPolyline *polyLine = [MKPolyline polylineWithCoordinates:coordinates count:numberOfSteps];
      [map addOverlay:polyLine];
  }
  </code></pre>
  
  <p>where "map" is an instance of MKMapView, and path the array representing the already decoded set of points. </p>
  
  <p>I thought that with the line <code>[map addOverlay:polyLine];</code> it would be drawn. I've seen in some pages this method:</p>
  
  <pre><code>- (MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id &lt;MKOverlay&gt;)overlay {
      MKPolylineView *polylineView = [[MKPolylineView alloc] initWithPolyline:overlay];
      polylineView.strokeColor = [UIColor redColor];
      polylineView.lineWidth = 1.0;
  
      return polylineView;
  }
  </code></pre>
  
  <p>Is the polylineView what is actually drawn on map? I've tried also to pass the MKPolyline (from the method above) to the "&lt;MKOverlay> overlay" argument of this last method, but throws an exception.</p>
  
  <p>I think I'm close, but I don't know what to do now.</p>
  
  <p>Please help! Thank you very much in advance.</p>