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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:10:12+00:00 2026-05-27T03:10:12+00:00

I am trying to annotate my map with MKPointAnnotation , like this: – (void)viewDidLoad

  • 0

I am trying to annotate my map with MKPointAnnotation, like this:

- (void)viewDidLoad
{
    NSLog(@"RootViewController viewDidLoad");

    [super viewDidLoad];

    CLLocationCoordinate2D coord = 
    CLLocationCoordinate2DMake(54.903683,23.895435);

    MKPointAnnotation *toyAnnotation = [[MKPointAnnotation alloc] init];

    toyAnnotation.coordinate = coord;
    toyAnnotation.title = @"Title";
    toyAnnotation.subtitle = @"Subtitle";

    [mapView addAnnotation:toyAnnotation];

    [toyAnnotation release];

}

- (MKAnnotationView *)mapView:(MKMapView *)m 
            viewForAnnotation:(id <MKAnnotation>)annotation
{
    NSLog(@"RootViewController mapView: viewForAnnotation:");
    NSLog(@"%@",annotation);

    MKAnnotationView *pin = [[MKAnnotationView alloc] 
                             initWithAnnotation:annotation 
                             reuseIdentifier:nil];

    pin.enabled = YES;
    pin.canShowCallout = YES;

    return [pin autorelease];
}

Pin fails to appear on the map. RootViewController is a delegate for mapView and thus mapView:viewForAnnotation: method gets called:

2011-11-24 15:04:03.808 App[2532:707] RootViewController mapView: viewForAnnotation:
2011-11-24 15:04:03.810 App[2532:707] <MKPointAnnotation: 0x1885c0>

What am I doing wrong and how to fix this issue?

  • 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-27T03:10:12+00:00Added an answer on May 27, 2026 at 3:10 am

    In viewForAnnotation, create an MKPinAnnotationView instead of an MKAnnotationView (for which you have to set the image).

    Although for a default pin annotation view, you don’t need to implement the delegate method at all.

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

Sidebar

Related Questions

Trying to get my css / C# functions to look like this: body {
I've got a query that looks like this affiliates = User.objects.annotate(referral_count=Count('referrals')) .filter(referral_count__gt=0) But when
I'm trying to produce something like this with JAXB: <person> <firstName>Foo</firstName> <lastName>Bar</lastName> <identities> <green
I'm trying to annotate some text onto a base image with a dropshadow. I
I'm trying to annotate a polar plot with data tips labelled with 'R:...,Theta:...' where
I'm trying to annotate a picture with the Dia application, by placing description boxes
I'm trying to to get Mercurial's annotate command to work on files specifed by
Trying to keep all the presentation stuff in the xhtml on this project and
I'm trying to use Django's annotate feature to add the count of a related
I was trying to make a tail-recursive version of this very simple SML function:

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.