I am using StoryBoards in my app. I have a MKMapView with annotations. I have implemented calloutAccessoryControlTapped method and want to navigate to TableView when user taps on UIButtonTypeDetailDisclosure.
(1) Is there a way to use segue from calloutAccessoryControlTapped?
(2) Without using segue I am getting a black screen.
- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control {
...
DetailViewController *detailViewController = [[DetailViewController alloc]init];
detailViewController.detailItem = managedObject;
[self.navigationController pushViewController:detailViewController animated:YES];
}
You can just create a push segue in your storyboard from this view controller to a DetailViewController. Then give the segue an identifier (look in the inspector for the "identifier").
And then if the identifier is, say, "presentDetailViewController", then you can just do this:
[self performSegueWithIdentifier:@"presentDetailViewController" sender:self];
Hope that helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With