Note that there are some explanatory texts on larger screens.

plurals
  1. POtrying to push a detail view when the right button is tapped on the annotation of mapview in xcode
    text
    copied!<p>i wanted to display the detail view after tapping the right button on the annotation of mapview in xcode but i could not get the view to display , my code:</p> <pre><code>- (void)showDetails:(id)sender { [self.navigationController setToolbarHidden:YES animated:NO]; [self.navigationController pushViewController:self.detailViewController animated:YES]; } - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id &lt;MKAnnotation&gt;)annotation { static NSString* BridgeAnnotationIdentifier = @"bridgeAnnotationIdentifier"; MKPinAnnotationView* customPinView = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:BridgeAnnotationIdentifier] autorelease]; customPinView.pinColor = MKPinAnnotationColorPurple; customPinView.animatesDrop = YES; customPinView.canShowCallout = YES; UIButton* rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; NSLog(@"%@",rightButton); [rightButton addTarget:self action:@selector(showDetails:) forControlEvents:UIControlEventTouchUpInside]; customPinView.rightCalloutAccessoryView = rightButton; return customPinView;//[kml viewForAnnotation:annotation]; } </code></pre> <p>The showDetails method gets called but cannot push the detailViewController to the top , </p> <pre><code>[self.navigationController pushViewController:self.detailViewController animated:YES]; </code></pre> <p>this code should have pushed detail view to the top and displayed the detailView but it does not please ,</p> <p>any help would be greatly appreciated , what i wanted to do is when anybody taps on the right button of annotation on the mapview ,i wanted to display a detail view , thanking you in advance..</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload