tags:

views:

30

answers:

1

Hi, Im tryin to make a mapview where I can get a location and its coordinates then send it to another view. I tried to use didSelectAnnotationView to send the information. But for some reason I'm not getting into the didSelectAnnotationView method.

Can someone tell me?

Or if I am doing something wrong. What method should I use?

thanks in advance

A: 

Make sure you add the delegate on the interface, and the method header names are correct.

Example:

@interface MapperViewController : UIViewController { IBOutlet MKMapView *mapView; } @property (nonatomic, retain) IBOutlet MKMapView *mapView;

  • (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view;

@end

This code should fire when user taps on pin head:

  • (void)mapView:(MKMapView *)mapView1 didSelectAnnotationView:(MKAnnotationView *)mapView2 { MapAnnotation *annotation = mapView2.annotation; NSString * temp = annotation.title; }
Simone Maynard