My map callouts don't display the image when clicked
- by Neelam Khan
I am developing an iPhone application for a university project and I'm new to iPhone development. I have looked through Apple's MapCallouts code but it doesn't seem feasible to implement it.
So far my code displays a map, drops annotations, displays the title and it displays the right call out button. But this is where I encounter problems.
When I press on the callout button, it displays a blank view controller but it should display a different image for every callout that's tapped and this isn't happening so far.
I have added my code below:
- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view
calloutAccessoryControlTapped:(UIControl *)control
{
//NSUInteger tag = ((UIButton *)control).tag;
if (self.detailController==nil)
{
DetailViewController* detailViewController = [[DetailViewController alloc] init];
[self.navigationController pushViewController:detailViewController animated:YES];
}
// self.detailController.tag =1; //to identify image required
// self.detailController.tag = tag;
[self.navigationController pushViewController:detailController animated:YES];
}