Usually, when I want to set the variable of another view controller within a specific view controller, I do this:
Now here's my problem. I am not using the prepareForSegue method in the case where a user clicks an annotation on mapkit:
So in the above case, I have no access to a segue parameter to target the destination controller to set the view.annotation as the value of one of its methods. So how would I target the destination controller in the above example?
thanks for response
Code:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
MyOtherViewController *_vc = [segue destinationViewController];
[_vc setUser:current_user];
}
Now here's my problem. I am not using the prepareForSegue method in the case where a user clicks an annotation on mapkit:
Code:
- (void)mapView:(MKMapView *)mapView
annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control {
NSLog(@"my current report is %@", view.annotation);
if ([(UIButton*)control buttonType] == UIButtonTypeDetailDisclosure){
[self performSegueWithIdentifier:@"ShowRemoteDetailViewManagerController" sender:self];
}
}
So in the above case, I have no access to a segue parameter to target the destination controller to set the view.annotation as the value of one of its methods. So how would I target the destination controller in the above example?
thanks for response