i have a map and the map have annotation , and i can see these annotation in table view as a cells then i can see the details for any cell i selected like the master details project in the xcode
like this
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([[segue identifier] isEqualToString:@"showDetail"]) {
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
Object *object = [self.objects objectAtIndex:indexPath.row];
DetailsViewController *detailsViewController = segue.destinationViewController;
detailsViewController.detailItem = object;
}
the code was for the cell in the table view that will push to the details view
but i want the user when he press UIButtonTypeDetailDisclosure in the annotation then the Button will go to the same DetailsViewController that the cell will go to in the table view
is it possible to do this ?
i have read about calloutAccessoryControlTapped but i'm not sure how to make the annotation that have been selected to be the detailItem that i have declared in the DetailsViewController
Thank you : )