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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:56:13+00:00 2026-06-06T23:56:13+00:00

My annotation (homeMark) are not showing in mapView. I have made my viewController delegate

  • 0

My annotation (homeMark) are not showing in mapView.
I have made my viewController delegate in IB

For some reason in the delegate method
if ([annotation isKindOfClass:[HomeMark class]]) {

Fails…..Annotation is not part of “Homemark” class…

What am i doing wrong ?

code…

- (IBAction)clubHouse:(id)sender{
    MKCoordinateRegion region = { {0.0, 0.0 } , {0.0,0.0} };
    region.center.latitude = 55.305858;
    region.center.longitude = 12.386036;


    CLLocationCoordinate2D coord = {
        .latitude = region.center.latitude, 
        .longitude = region.span.longitudeDelta};

    HomeMark *homeMark = [[HomeMark alloc] 
                          initWithCoordinate:coord 
                          andMarkTitle:@"Klubhus" 
                          andMarkSubTitle:@"Stevns Cykel Motion"];

    [mapMyView addAnnotation:homeMark];

    [mapMyView setMapType:MKMapTypeStandard];
    [mapMyView setZoomEnabled:YES];
    [mapMyView setScrollEnabled:YES];
    region.span.longitudeDelta = 0.007f;
    region.span.latitudeDelta = 0.007f;
    [mapMyView setRegion:region animated:YES];
    //[mapMyView setDelegate:sender];    
    mapMyView.showsUserLocation = YES;

}

And the ViewForAnnotation.

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

    static NSString *identifier = @"MyLocation";
    if ([annotation isKindOfClass:[HomeMark class]]) {

        MKPinAnnotationView *annotationView = (MKPinAnnotationView *) [mapView dequeueReusableAnnotationViewWithIdentifier:identifier];
        if (annotationView == nil) {
            annotationView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:identifier];
        }
        else {
            annotationView.annotation = annotation;
        }

        annotationView.enabled = YES;
        annotationView.canShowCallout = YES;

        return annotationView;
    }

    return nil; 
}
  • 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-06T23:56:14+00:00Added an answer on June 6, 2026 at 11:56 pm

    It looks like you are specifying the coordinates incorrectly so that the annotation is not where you expect.

    Instead of this:

    CLLocationCoordinate2D coord = {
        .latitude = region.center.latitude, 
        .longitude = region.span.longitudeDelta};  // <-- span doesn't make sense
    

    try this:

    CLLocationCoordinate2D coord = {
        .latitude = region.center.latitude, 
        .longitude = region.center.longitude};  // <-- not span
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have this annotation class @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface MethodXY { public int
I have created Custom Annotation with following: -(MKAnnotationView*)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation { MKPinAnnotationView *view =
Is there an annotation/attribute which can be set on a controller method, to have
Is there an annotation to declare that a certain method will not be included
I have custom annotation pin at app: - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation {
I have an annotation showing in mapkit with a custom image, showing fine, but
I have a controller annotation defined like so : @RequestMapping(value = /myServlet , method
I have an annotation: @Inherited @InterceptorBinding @Retention(RUNTIME) @Target({METHOD, TYPE}) public @interface Example { }
I am using Spring MVC with annotation configuration. I have a controller class for
I have this data annotation in my class [Required(ErrorMessage = Introduce a number!)] [RegularExpression([0-9]+,

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.