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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:15:18+00:00 2026-05-23T11:15:18+00:00

Hi can some1 plz help me…. The problem is this: Everything seems alright.. i

  • 0

Hi can some1 plz help me….

The problem is this: Everything seems alright.. i am able to push to another page once i tap on the detailButton. However, the page which i am able to push to is always only a view without any values passed into the labels. All my labels in the view have nothing inside.. Am i doing something wrong or any wrong concept here?

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

    BOOL isRed = NO;
    //BOOL isPurple = YES;

    if([annotation isKindOfClass:[MyAnnotation2 class]])
        isRed = YES;



    MKPinAnnotationView *pinView = nil;



    if(isRed) {
        static NSString *redPin = @"redPin";
        pinView = (MKPinAnnotationView *) [mapView dequeueReusableAnnotationViewWithIdentifier:redPin];
        if (!pinView) {
            pinView = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:redPin] autorelease];
            pinView.pinColor = MKPinAnnotationColorRed;
            pinView.animatesDrop = YES;
            pinView.canShowCallout = YES;

            UIButton *detailButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];


            pinView.rightCalloutAccessoryView = detailButton;

        }

        else{
            pinView.annotation = annotation;
        }    
    }
    else {
        static NSString *greenPin = @"greenPin";
        pinView = (MKPinAnnotationView *) [mapView dequeueReusableAnnotationViewWithIdentifier:greenPin];
        if (!pinView) {
            pinView = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:greenPin] autorelease];
            pinView.pinColor = MKPinAnnotationColorGreen;
            pinView.animatesDrop = NO;
            pinView.canShowCallout = YES;
            UIButton *detailButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];


            pinView.rightCalloutAccessoryView = detailButton;

        }

    }  
    return pinView; 

}

//

- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control
{
    NSLog(@"calloutAccessoryControlTapped");

if (self.patientDetailsViewController == nil) {
    self.patientDetailsViewController = [[[PatientDetailsViewController alloc] initWithNibName:@"PatientDetailsViewController" bundle:nil] autorelease];        
} 

MyAnnotation2 *selectedObject = (MyAnnotation2 *)view.annotation;
_patientDetailsViewController.nric = selectedObject.title;
NSLog(@"%@",_patientDetailsViewController.nric);
[self.navigationController pushViewController:_patientDetailsViewController animated:YES];

}

  • 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-23T11:15:19+00:00Added an answer on May 23, 2026 at 11:15 am

    Don’t use your own target/action and tagging for the callout accessory button.

    Instead, use the MKMapViewDelegate method calloutAccessoryControlTapped:. Remove the addTarget line and implement the delegate method.

    In that delegate method, you can access the annotation tapped using:

    MyAnnotation2 *selectedObject = (MyAnnotation2 *)view.annotation;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

please someone help out from this headaround problem of me; I have dynamically created
can some on help me on how i can reference images i have all
i need some idea for creatin a encryption program can any one help!? i
Hi there everyone im a newbie so can anyone of u help me solve
I already looked up many posts about this problem (subqueries being very slow in
I added this in the head section of my page as told in the
Can some one specify the windows API, one need to use in order to
Can some one post an example of using syslog outputter for log4r, I am
Can some one explain to me the difference between categories and inheritance in Objective
Can some one recommend any free program which counts the number of clicks Clicked

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.