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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:59:03+00:00 2026-06-04T07:59:03+00:00

I have a map view and there are 10 store locations which data comes

  • 0

I have a map view and there are 10 store locations which data comes via webservice. I just want to push to my detail view to show address, telephone and other informations of the clicked store.

I need to pass data to my detailview when user tapped or touch up inside to a annotation on mapkit. There are 10 annotations in my mapview and first I want to know, how can I understand or how can I get the annotationID of which annotation is clicked?

this is the method I return pins

 - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation
{

    if ([annotation isKindOfClass:[MKUserLocation class]]) return nil;

    static NSString* AnnotationIdentifier = @"AnnotationIdentifier";

    MKPinAnnotationView* pinView = [[MKPinAnnotationView alloc]initWithAnnotation:annotation reuseIdentifier:AnnotationIdentifier];

     pinView.animatesDrop=YES;
     pinView.canShowCallout=YES;
     pinView.pinColor=MKPinAnnotationColorPurple;

     UIButton* rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
     [rightButton setTitle:annotation.title forState:UIControlStateNormal];

     [rightButton addTarget:self
     action:@selector(showDetails:)
     forControlEvents:UIControlEventTouchUpInside];

     pinView.rightCalloutAccessoryView = rightButton;

    return pinView;
}
   /* and my action method for clicked or tapped annotation: */

 - (IBAction)showDetails:(id)sender{

      NSLog(@"Annotation Click");

      [[mtMap selectedAnnotations]objectAtIndex:0];
      magazaDetayViewController *detail = [[magazaDetayViewController 
      alloc]initWithNibName:@"magazaDetayViewController" bundle:nil];

      detail.sehir=@"";
      detail.magazaAdi=@"";
      detail.adres=@"";
      detail.telefon=@"";
      detail.fax=@"";
      [self.navigationController pushViewController:detail animated:YES];

 }

if i can just get the clicked annotation index no i can fill detail properties with my array.
if this is impossible is there any other way to do it?

  • 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-04T07:59:05+00:00Added an answer on June 4, 2026 at 7:59 am

    First in your annotaion view delegat make a button to go in detail view like bellow:

    -(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation{
    
    MKPinAnnotationView *mypin = [[MKPinAnnotationView alloc]initWithAnnotation:annotation reuseIdentifier:@"current"];
    mypin.pinColor = MKPinAnnotationColorPurple;
    mypin.backgroundColor = [UIColor clearColor];
    UIButton *goToDetail = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
    mypin.rightCalloutAccessoryView = myBtn;
    mypin.draggable = NO;
    mypin.highlighted = YES;
    mypin.animatesDrop = TRUE;
    mypin.canShowCallout = YES;
    return mypin;
    }
    

    Now use the following delegate whenever the button in annotationView will get tapped the following delegate will be called from where you can easly get which particular annotaion’s button is tapped

    - (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view 
     calloutAccessoryControlTapped:(UIControl *)control
    {
    annotation *annView = view.annotation;
    detailedViewOfList *detailView = [[detailedViewOfList alloc]init];
    detailView.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
    detailView.address = annView.address;
    detailView.phoneNumber = annView.phonenumber;
    [self presentModalViewController:detailView animated:YES];
    }
    

    here annotaion is a class importing MKAnnotaion.h and address and phonenumber are properties of annotaion class you can make many more while the address and phoneNumber properties of detailView class are strong. So that you can pass values. Hope this will help you!

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

Sidebar

Related Questions

I have a view containing a UIWebView which is loading a google map (so
In my application, I have a map view displaying nearby locations in a regeon.
I'm trying to do something which seems simple. I want to have a map
So I have a map view in which if I tap on the accessory
i have another (probably unanswered) question about map views. I have a map view
I have a single annotation on a map view. I can select it programmaticly,
can i use fragments and map view in the same activity. I have seen
I use AutoMapper to map my domain objects to my view models. I have
I have map with 30-50 polygons on it. There are like 4000 points in
Is there a way to start an activity from a view? I have this

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.