Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Three steps. </p> <p>1) In your header file (.h) <em>or</em> your implementation file's (.m) class extension conform to <code>MKMapViewDelegate</code>:</p> <pre><code>@interface ViewController : UIViewController &lt;MKMapViewDelegate&gt; { ... } </code></pre> <p>2) Set your view controller as the delegate of <code>MKMapViewDelegate</code> to receive delegate callbacks. Commonly done in <code>viewDidLoad</code>:</p> <pre><code>- (void)viewDidLoad { [super viewDidLoad]; self.mapView.delegate = self; } </code></pre> <p>3) Implement the following delegate function to show the disclosure button:</p> <pre><code>- (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id &lt;MKAnnotation&gt;) annotation { MKPinAnnotationView *newAnnotation = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"pinLocation"]; newAnnotation.canShowCallout = YES; newAnnotation.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; return newAnnotation; } </code></pre> <p>the following function will assist in determining what action (in your case, presenting a view) is taken upon touching the disclosure button. </p> <pre><code>- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control { //launch a new view upon touching the disclosure indicator TestVCViewController *tvc = [[TestVCViewController alloc] initWithNibName:@"TestVCViewController" bundle:nil]; [self presentViewController:tvc animated:YES completion:nil]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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