I am trying to make a map, where I can see my current location, and see what the street is called.
so far, I am able to put a pin on my map, but for some reason, I a
I had the same problem, as you mentioned. The delegate had been set to ViewController, but the viewForAnnotation
selector was not being called. After some checks, I realized if you do not call addAnotation
in the main thread, mapView would not call viewForAnnotation
, so following update resolved my problem:
Before:
[_mMapView addAnnotation:marker];
After:
dispatch_async(dispatch_get_main_queue(), ^{
[_mMapView addAnnotation:marker];
});
i have been working in ios 9 Mapview related app and I experienced the same problem.
somehow I solved my problem, in my case im resizing the mapview
.
I added delegate
after i resize the mapview
. it works now perfectly.!
I had the same problem which was not setting the MapView delegate to the File Owner.
After having set the delegate for the mapview if still the viewforannotation not getting called then this is something which you have missed - set the self.mapView.showsUserLocation to YES, in interface builder you can tick the shows userLocation option in attributes inspector.
Others have already explained, odds are high you have not connected your mapview delegate to your controller. Its the first thing to check
Could it be that your annotation has been added outside the current view area of the MKMapView?