I have the function
Code:
- (MKAnnotationView *) mapView:(MKMapView *)mV viewForAnnotation:(id <MKAnnotation>) annotation {
}
where I create a custom map marker. I have an image where I am adding a label to the top. Each marker has an product number. Well, currently they all have the same. This is the problem! I have a function called plotPoints which will plot the lat, lng and add labels for the default pin marker.
the plotPoints function is called when looping through an array of products.
This works nicely, but I need to somewhere pass that product id (NSString) to the viewForAnnotation function. How do I do this? So I need
Code:
- (MKAnnotationView *) mapView:(MKMapView *)mV viewForAnnotation:(id <MKAnnotation>) annotation {
UILabel *tmpLabel = [[UILabel alloc] init];
tmpLabel.text = _SOME_VARIABLE; //@"FFR4432";
}
Any ideas? I have tried all sorts!