title: Draw line between two annotation pins on map using address strings/geocoding. -Objective C
body: <p><img src="https://i.stack.imgur.com/LWSRb.png" alt="Error Screenshot"></p>
  
  <p><img src="https://i.stack.imgur.com/QiBjQ.jpg" alt="Map Screenshot"></p>
  
  <p>I would like to draw a line between two annotation pins based on address strings.  The address labels are pre-filled with data from the user and can be any location in the united states.  I already have an annotation on each address, I am just unsure of what to put for the coordinate array (lat, long) in order to draw a line between these two points.  I have attached 2 screenshots to help clarify and show the errors I am receiving. </p>
  
  <p>Here is how I am annotating each address:</p>
  
  <pre><code>     NSString *location = [(UILabel *)[[self view] viewWithTag:1]text];;
  CLGeocoder *geocoder = [[CLGeocoder alloc] init];
  [geocoder geocodeAddressString:location
               completionHandler:^(NSArray* placemarks, NSError* error){
                   if (placemarks &amp;&amp; placemarks.count &gt; 0) {
                       CLPlacemark *topResult = [placemarks objectAtIndex:0];
                       MKPlacemark *placemark = [[MKPlacemark alloc] initWithPlacemark:topResult];
  
                       MKCoordinateRegion region = self.mapView.region;
  
  
                       [self.mapView setRegion:region animated:NO];
                       [self.mapView addAnnotation:placemark];
                   }
               }
   ];
  
  NSString *location2 = [(UILabel *)[[self view] viewWithTag:6]text];;
  CLGeocoder *geocoder2 = [[CLGeocoder alloc] init];
  [geocoder2 geocodeAddressString:location2
               completionHandler:^(NSArray* placemarks, NSError* error){
                   if (placemarks &amp;&amp; placemarks.count &gt; 0) {
                       CLPlacemark *topResult = [placemarks objectAtIndex:0];
                       MKPlacemark *placemark = [[MKPlacemark alloc] initWithPlacemark:topResult];
  
                       MKCoordinateRegion region = self.mapView.region;
  
                       [self.mapView setRegion:region animated:NO];
                       [self.mapView addAnnotation:placemark];
  
  
                   }
               }
   ];
  </code></pre>
  
  <p>Here is the error where I do not know what to put for latitude and longitude in the coordinate array:</p>
  
  <pre><code>      CLLocationCoordinate2D coordinateArray[2];
  coordinateArray[0] =  CLLocationCoordinate2DMake(lat1, lon1);&lt;- NEED HELP HERE
  coordinateArray[2] = CLLocationCoordinate2DMake(lat2, lon2);&lt;- NEED HELP HERE
  
  
  self.routeLine = [MKPolyline polylineWithCoordinates:coordinateArray count:2];
  [self.mapView setVisibleMapRect:[self.routeLine boundingMapRect]]; //If you want the route to be visible
  
  [self.mapView addOverlay:self.routeLine];
  </code></pre>