title: IOS 7 - add overlay crash app
body: <p>I am in a process of moving my app to <strong>IOS 7</strong>.<br/>
  I have a map and on that map I draw <code>MKPolyLine</code>.<br/>
  Everything worked until IOS 7 now app crash.<br/>
  I have changed <code>viewForOverLay</code> with new method:</p>
  
  <pre><code>- (MKOverlayRenderer *)mapView:(MKMapView *)mapView rendererForOverlay:(id &lt; MKOverlay &gt;)overlay
  {
      if ([overlay isKindOfClass:[MKPolyline class]]) {
          MKPolyline *route = overlay;
          MKPolylineRenderer *routeRenderer = [[MKPolylineRenderer alloc] initWithPolyline:route];
          routeRenderer.strokeColor = [UIColor redColor];
          routeRenderer.lineWidth = 7;
          return routeRenderer;
      }
      else return nil;
  }
  </code></pre>
  
  <p>In ViewDidLoad I call:</p>
  
  <pre><code>[self performSelectorInBackground:@selector(drawPathInBackground) withObject:nil];
  </code></pre>
  
  <p>And this is the implementation:</p>
  
  <pre><code>-(void)drawPathInBackground{
  for(int idx = 0; idx &lt; [routes count]; idx++)
      {
          Path *m_p = [routes objectAtIndex:idx];
          CLLocationCoordinate2D workingCoordinate;
          workingCoordinate.latitude=m_p.Latitude;
          workingCoordinate.longitude=m_p.Longitude;
          MKMapPoint point = MKMapPointForCoordinate(workingCoordinate);
          pointArr[idx] = point;
      }
      self.routeLine = [MKPolyline polylineWithPoints:pointArr count:[routes count]];
      //[self.mapView addOverlay:self.routeLine];
      //free(pointArr);
      dispatch_async(dispatch_get_main_queue(), ^{
      [self.mapView addOverlay:self.routeLine];
      free(pointArr);
  });
  }
  </code></pre>
  
  <p>On this line: <code>[self.mapView addOverlay:self.routeLine];</code> I get: <strong>EXC_BAD_ACCESS(code = 2, address = 0x0)</strong></p>