You have to conform to the MKMapViewDelegate protocol in the header of your ViewController.
@interface mapViewController : UIViewController <MKMapViewDelegate>
@end
Then, in the implementation you have to write the method :
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation
That is called each time an annotation is drawn. It's here that you should call your method, not only when adding the annotation.
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation
{
MKAnnotationView *pinView = [self returnPointView:annotation.coordinate andTitle:annotation.title andColor:MKPinAnnotationColorGreen];
return pinView;
}
Finally, set the ViewController as its UIMapView delegate delegate in viewDidLoad :
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
[self.mapView setDelegate:self];
}
I suggest you have a look at the MapCallouts example project in Xcode, it's clear and simple.
Just as well, you should use dequeueReusableAnnotationViewWithIdentifier
in order to be more memory efficient (as does the example).