Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8050253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:01:11+00:00 2026-06-05T07:01:11+00:00

In my iphone app, I have a controller with a view and MKMapView. I

  • 0

In my iphone app, I have a controller with a view and MKMapView.
I display several annotation on the map, but when I click on the annotation view the “calloutAccessoryControlTapped” is triggered but I’m not able to push a new view.
self.navigationView is null… what is the best way to do this ? Do I need to create a navigation controller on top of the MKMapView ?

-(void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control
{
  NSLog(@"annotation clicked"); // => OK
  if ([control isKindOfClass:[UIButton class]]) {
    NSLog(@"annotation clicked 2"); // => OK

    // Get annotation as some stuff needs to be passed to the new view
    MyAnnotation *annotation = (MyAnnotation*)view.annotation;        

    ControlViewController *controlViewController = [[ControlViewController alloc] initWithNibName:@"ControlViewController" bundle:nil];
    controlViewController.thing = annotation.thing;

    NSLog(@"self.navigationController:%@", self.navigationController);  // => null

    // [self.navigationController pushViewController:controlViewController animated:YES];
    [controlViewController release];
  }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T07:01:12+00:00Added an answer on June 5, 2026 at 7:01 am

    Yep, your view controller needs to be inside a UINavigationController. Check the docs to learn how to do it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a regular old iPhone app that has a main view controller that
I have a view controller in my iphone app setup so that when I
I have an iPhone app that displays a modal view controller. The modal view
I have an iPhone app which has a tabBarController as the root view controller
In my iPhone app, I have a view controller with two views (essentially, a
I have an iPhone app that is based on a navigation controller. I have
I have an iPhone app using a UINavigationController. On the fourth controller of the
In my iPhone app I have a table view where I add a tick
I have an iPhone app with a tableviewcontroller. When you click a certain cell
I'm writing an iPhone app. Starting from a view controller in a navigation stack

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.