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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:10:36+00:00 2026-06-05T08:10:36+00:00

How can I detect back in my mapview (master) controller that the detail view

  • 0

How can I detect back in my mapview (master) controller that the detail view controller has been dismissed? I have a mapview with pins and annotations. When the rightCalloutAccessoryView has been tapped on any annotation, a modal detail view controller is called via performSegueWithIdentifier. Incidentally, I don’t know if this is correct or not, but the master and detail view controllers are attached by a navigation controller.

My goal is to take conditional action back on the mapview (master view) based on the user action on the detail view controller. Specifically if they have tapped the Remove Pin feature, I want to remove the pin when control returns to the mapview. If they simply tap the Done button, then I want the pin and annotation to remain on the screen.

With my limited knowledge, I’m able to remove the pin with the second line below but the problem is that I can see that the pin and annotation is removed right after the rightCalloutAccessorView icon is tapped and before the detail view is displayed. So what that means is that if the user then taps the Done button on the detail screen, they would then return to the mapview with the pin and annotation removed already. I only want it removed if the user taps the Remove button.

   [self performSegueWithIdentifier:@"PinDetail" sender:self];
   [self.mapView removeAnnotation:MA];

So my question really are:

  1. Where do I put in the removeAnnotation code? In it’s current place, the removal of the pin takes place even before the detail view appears.
  2. How can I detect if the Remove button on the detail view has been tapped?

Thanks.

  • 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-05T08:10:37+00:00Added an answer on June 5, 2026 at 8:10 am

    You can use delegate to perform action on mapview based on action in detail view.In performSegueWithIndentifier you can assign your detail view as delegate of mapview and it will perform action for you.

    Or you can set target and selector for detail view and when any action happens in detail view you can call that selector whose target is map view, as follows:
    1.In performSegue method set target as follows:

     [theController setTarget:self andSelector:@selector(performAction)];
    

    where theController is your destination view controller ie detail view controller.

    2.In detail view controller .h file

     id m_Target;
      SEL m_Selector;
    

    In detail view controller.m file:

    - (void)setTarget:(id)inTarget andSelector:(SEL)inSelector
    {
        m_Target = inTarget;
        m_Selector = inSelector;
    }
    

    3.Before dismissing detail view call

     if ([m_Target respondsToSelector:m_Selector]) {
                [m_Target performSelector:m_Selector withObject:nil];
            }
    

    4.Define performAction in map view controller .m file

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

Sidebar

Related Questions

Is there any way I can detect when a line break has been erased
I'd like to know how I can detect that the back button is clicked
In ActionScript 3, can I detect when the user has clicked their back or
I know that richtextboxes can detect links (like http://www.yahoo.com ) but is there a
Is there anyway that we can detect when the system/screen gets locked and notify
Is there any way that I can detect browser type on routing and use
Is there a way in which I can detect the URL that is calling
I have a .Net service that uses SENS to detect when a user logs
Can I detect with Javascript if the client has the needed runtime to run
Is there a way ActionScript 3 can detect the user's screen resolution?

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.