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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:48:48+00:00 2026-05-26T23:48:48+00:00

I have a mapkit application, where I’ve created a custom callout view. I can’t

  • 0

I have a mapkit application, where I’ve created a custom callout view. I can’t seem to get the labels on the view to update though. Here’s my setup:

I have a custom annotation class called VendorAnnotation with 5 string properties (phone and 4 address lines). The VendorAnnotation objects have their rightCalloutAccessoryView set to a UIButton. In the delegate method:
`(void)mapView:(MKMapVIew *)mapView annotationView:(MKAnnotationView *)view calloutAccessroyControlTapped:(UIControl *)control{}
I access the 5 strings via the annotations properties:
VendorAnnotation v = (VendorAnnotation*) view.annotation;
Then I have:
DetailViewController *detailVC = [[DetailViewController alloc] initWithDetails:v.phone add1:v.add1 add2:v.add2 add3:v.add3 add4:v.add4];
I know by stepping through, that at this point these string properties (v.*) have accurate values.
The problem is, this initWithDetails method doesn’t set the label texts. Here is my code for the DetailViewController class:

DetailViewController.h:

@interface DetailViewController : UIViewController
{
  IBOutlet UILabel *_phone;
  IBOutlet UILabel *_add1;
  IBOutlet UILabel *_add2;
  IBOutlet UILabel *_add3;
  IBOutlet UILabel *_add4;
}


- (id)initWithDetails:(NSString *)p add1:(NSString *)a add2:(NSString *)aa add3:(NSString *)aaa add4:(NSString *)aaaa;
@end

DetailViewController.m:

#import "DetailViewController.h"

@implementation DetailViewController


- (id)initWithDetails:(NSString *)p add1:(NSString *)a add2:(NSString *)aa add3:(NSString *)aaa add4:(NSString *)aaaa

{
  self = [super init];
  if (self) {
    [_phone setText:p];
    [_add1 setText:a];
    [_add2 setText:aa];
    [_add3 setText:aaa];
    [_add4 setText:aaaa];
  }
  return self;
}

I don’t know why, but the labels’ text property never gets set to the appropriate strings. Please help. I know it’s something stupid, I’m new to objective C and iOS programming, but I don’t see the problem. I should probably mention that I have connected the labels on the .xib in IB to the appropriate IBOutlet properties.

  • 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-26T23:48:48+00:00Added an answer on May 26, 2026 at 11:48 pm

    maybe because “p”, “a”, “aa”… aren’t initiated..

    Try it on - (void)viewDidLoad instead init.

    Or instead of using:

    detailVC = [[DetailViewController alloc] initWithDetails:v.phone add1:v.add1 add2:v.add2 add3:v.add3 add4:v.add4]; 
    

    why don’t you use the custom init method and then do something like this:

    detailVC.YOUR_LABEL.text = @"Your TEXT";
    

    or

    detailVC.YOUR_LABEL.text = v.add1;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have mapkit view, how i can convert latitude and longitude to screen coordinates?
I am using the MapKit for the iPhone and have it setup to get
In my iphone application, I'm using MapKit with MKMapView and custom MKAnnotationView. The problem
Developing iphone application using makkit framework. I have got the map view integrated in
I have mapkit view and i need to fix zoom step. User must only
I'm currently developing an iPad application that integrates MapKit. But I have a small
Background: I have created an application that allows users to submit an entry to
In my application I am using mapkit. All the time I have more than
I have a mapkit / view and it works fine - but I scroll
I have an application that uses MapKit/Internet connection OR CoreLocation to make its job.

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.