I'm trying to pass an annotation's title to the second view controller with the calloutAccessoryControlTapped
method like this:
- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view
calloutAccessoryControlTapped:(UIControl *)control
{
//My second VC's UILabel outlet
self.lblAnnotationTitle.text = view.annotation.title;
[self performSegueWithIdentifier:@"gymDetails" sender:self];
}
When the view controller shows up, the label is not updated yet. Why is that so?
Also, is this the right way to pass properties to another view controller? If not, what is a better way to do this?