My map callouts don't display the image when clicked
Posted
by
Neelam Khan
on Stack Overflow
See other posts from Stack Overflow
or by Neelam Khan
Published on 2012-03-30T17:19:14Z
Indexed on
2012/06/15
15:16 UTC
Read the original article
Hit count: 295
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];
}
© Stack Overflow or respective owner