I am having a problem disabling my mapView when I call this in - (void)viewDidLoad
NSString *template = @"http://tile.openstreetmap.org/{z}/{x}/{y}.png";
self.onlineOverlay = [[MKTileOverlay alloc] initWithURLTemplate:template];
self.onlineOverlay.canReplaceMapContent = YES;
[_mapView addOverlay:self.onlineOverlay level:MKOverlayLevelAboveLabels];
Magazine: (with zombie objects included)
*** -[VKRasterOverlayTileSource invalidateRect:level:]: message sent to deallocated instance 0xf1863e0
This only happens when I close the view controller containing the map display too quickly. If I wait a few seconds, this will not work. The view controller shuts down by unloading it from the navigation controller,
I tried several options:
mapViewand mapView.delegateset nilto- (void) dealloc and in - (void)viewDidDisappearBOOL finishedLoadingwhich is set to FALSEwhen the view is loaded and set to TRUEwhen the delegate method of the map view is - (void)mapViewDidFinishRenderingMap:(MKMapView *)mapView fullyRendered:(BOOL)fullyRenderedcalled.- (void)mapView:(MKMapView *)mapView didAddOverlayRenderers:(NSArray *)renderersseems to be called before the method is executed.
How to check if the overlay is fully added?
, ?
EDIT:
.
. , , , addOverlay: - .
MapView viewController .