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
For storyboard, Ctl drag the MKMapView to the orange circle on the bottom bar of ViewController, and select delegate.
This will solve the problem.
As vatrif mentioned in the comments, you must set your delegate BEFORE adding annotations to your MKMapView object.
In order to get the viewForAnnotation
to be called, add mapView.delegate=self;
to e.g. the viewDidLoad
method:
- (void)viewDidLoad {
[super viewDidLoad];
mapView.delegate=self;
}