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 616409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:19:27+00:00 2026-05-13T18:19:27+00:00

I want to add a new view on a rightcalloutaccessoryview button press. I currently

  • 0

I want to add a new view on a rightcalloutaccessoryview button press. I currently have the functionality for dropping a pin on the map. A callout (MKAnnotation) with a title, subtitle, and chevron loads when I tap the pin. When I tap the chevron (rightcalloutaccessoryview) I want another view to pop up showing more information at this point. Right now, the chevron tap does nothing. This is what I have:

-(IBAction)showInfo:(id)sender 
{     
     int calloutButtonPressed = ((UIButton *)sender).tag;
     if(calloutButtonPressed < 99999)
     {
          if(self.DetailView == nil)
          {
               DetailViewController *tmpViewController = [[UIViewController alloc] initWithNibName:@"DetailView" bundle:nil];
               self.DetailView = tmpViewController;
               [tmpViewController release];
          }

          if (calloutButtonPressed == 1) 
          {
                         // Using the debugger, I found that calloutButtonPressed is equal to 0 when the button is pressed.
                         // So I'm not sure what the point of this method is...
                }
          self.DetailView.title = @"Title";
     }
 }

I have verified that this action method does get called upon pressing the chevron. Unfortunately, I can’t get it to pull up a new view. If anyone knows what I’m doing wrong, please let me know. I’m in a bit of a pinch…

Thanks!

Thomas

  • 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-05-13T18:19:27+00:00Added an answer on May 13, 2026 at 6:19 pm
        -(IBAction)showInfo:(id)sender 
    {   
         int calloutButtonPressed = ((UIButton *)sender).tag;
         if(calloutButtonPressed < 99999)
         {
              if(self.detailView == nil)
              {
                   DetailViewController *tmpViewController = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil];
                   self.detailView = tmpViewController;
                   [tmpViewController release];
              }
    
              [self.navigationController pushViewController:self.detailView animated:YES];
    
              if (calloutButtonPressed == 0) 
              {
                   // TRP - I inserted my view atIndex:99999 to ensure that it gets placed in front of all windows
                   // TODO: figure a better way to do this
                   [self.view insertSubview:detailView.view atIndex:99999];
              }
              self.detailView.title = @"Title";
         }
    
    }
    

    It was missing this one statement:

    [self.view insertSubview:detailView.view atIndex:99999];
    

    I would like to find another way so I don’t have to have that magic number (99999) in there (plus, it seems kinda immature…). I’m not TOO worried about it, because it works though.

    I got my help from the Apple Developer Forums, here.

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

Sidebar

Related Questions

I have vendors/show view with button Add new item button. When i press Add
I have create the list-activity.Now I want to add new view with with map
I want to add method that opens up the new view controller when this
i want to add a new View Which Contain Anything in a window based
Every time I want to add new code to my site I have to
I want to add button which will toggle between normal and satellite view in
I have a tableView and want to add a new viewController so that when
I want to use addSubview method to add new view on my screen. However,
I have one grid view which i want to add in footer of listview
I have a LinearLayout view that already contains several elements. I want to add

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.