title: Trying to get MKPolygon overlay working
body: <p>Trying to figure out this MKPolygon working. I've created a whole heap MKMapPoints and placed them into an array. Then I make a Polygon out of them with: </p>
  
  <pre><code>[MKPolygon polygonWithPoints:pointArr count:sqlite3_column_int(countStatement, 0)];
  </code></pre>
  
  <p>and add that to an Array for retrieval later.</p>
  
  <p>Later I loop through the array and add each object (MKPolygon) to the map with:</p>
  
  <pre><code>[mapView addOverlay:[overlays objectAtIndex:i]];
  </code></pre>
  
  <p>And this according to logs works fine.</p>
  
  <p>I then implement mapView: viewForOverlay: like so</p>
  
  <pre><code>- (MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id &lt;MKOverlay&gt;)overlay {
  MKOverlayView *theOverlayView = nil;
  for (MKPolygon *theOverlay in overlays) {
      if (theOverlay == overlay) {
          MKPolygonView *thePolygonView = [[[MKPolygonView alloc] initWithPolygon:theOverlay] autorelease];
          theOverlayView = thePolygonView;
  
      }
  }
  return theOverlayView;
  }
  </code></pre>
  
  <p>As far as I can see this should technically work. But it doesn't, the App just crashes when it gets to the region of the map that I think its on (points may be wrong because of lat long mixup or conversion mistake but thats another thing)</p>
  
  <p>Am I missing some property I need to set or could the incorrect points be causing the crash? Or am I missing it entirely?</p>
  
  <p>Cheers for any help.</p>