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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:30:22+00:00 2026-06-01T22:30:22+00:00

I am loading a map view. And I am adding pins to the map,

  • 0

I am loading a map view. And I am adding pins to the map, based on address of the contacts in address book. I am having some strange cases where some pins(maybe 2 out of 10) don’t drop in the map view . I have checked the address, which is valid. But the pin is not dropping. What could be the reason for this.

    for (i = 0; i<[groupContentArray count]; i++) {
        person = ABAddressBookGetPersonWithRecordID(addressbook,[[groupContentArray objectAtIndex:i] intValue]);
        ABMultiValueRef addressProperty = ABRecordCopyValue(person, kABPersonAddressProperty);
        NSArray *address = (NSArray *)ABMultiValueCopyArrayOfAllValues(addressProperty);
        NSLog(@"Address %@", address);
        for (NSDictionary *addressDict in address) 
        {
            addAnnotation = nil;
            firstName = (NSString *)ABRecordCopyValue(person, kABPersonFirstNameProperty); 
            lastName = (NSString *)ABRecordCopyValue(person, kABPersonLastNameProperty); 

            NSString *country = [addressDict objectForKey:@"Country"];
            NSString *streetName = [addressDict objectForKey:@"Street"];
            NSString *cityName = [addressDict objectForKey:@"City"];
            NSString *stateName = [addressDict objectForKey:@"State"];

            if (streetName == (id)[NSNull null] || streetName.length == 0 ) streetName = @"";
            if (stateName == (id)[NSNull null] || stateName.length == 0 ) stateName = @"";
            if (cityName == (id)[NSNull null] || cityName.length == 0 ) cityName = @"";
            if (country == (id)[NSNull null] || country.length == 0 ) country = @"";


            NSString *fullAddress = [streetName stringByAppendingFormat:@"%@/%@/%@", cityName, stateName, country];
            mapCenter = [self getLocationFromAddressString:fullAddress];
            if(stateName != NULL || country != NULL || streetName != NULL || cityName != NULL){

                if ((mapCenter.latitude == 0) && (mapCenter.longitude == 0))
                {
                    // Alert View
                }
                else{
                addAnnotation = (MyAddressAnnotation *)[mapView dequeueReusableAnnotationViewWithIdentifier:[groupContentArray objectAtIndex:i]];

                if(addAnnotation == nil){
                    addAnnotation = [[[MyAddressAnnotation alloc] initWithCoordinate:mapCenter title:firstName SubTitle:lastName Recordid:[groupContentArray objectAtIndex:i] ]autorelease];

                    [mapView addAnnotation:addAnnotation];}
                                    }
            }
        }
        CFRelease(addressProperty);

    }

Edit: I am editing my question and be more specific. I am using the code to drop pins on my mapView. On my Mac PC, if there are 20 pins to be dropped in the map. All the 20 pins are dropping accurately and working fine. But when I am using IPhone or IPad, the pin count reduces massively. That is, out of some 20 pins I am dropping, only 4 pins are showing on the map. I am not able to figure out a reason for this.

  • 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-01T22:30:23+00:00Added an answer on June 1, 2026 at 10:30 pm

    My bad. In the “fulladdress” string(between streetName and cityName) that I use, were not separated by a space or “,” or “/”. Therefore some of the addresses were not being recognised.

    • 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
i am loading a mapviewcontroller when the view map button is pressed from my
I'm displaying some icons (annotations) on a map in my app by loading them
I am loading an annotation onto my map view. The annotation displays as a
In the DOM I am loading a static Google Map image. When the document
Does anyone know why loading a KML file into my sencha touch google map
Im getting this Error when loading an ESRI map inside the Android Environment. This
I am loading a mapview into a viewcontroller's view. When I load the mapview,
I am working on a map application in iPhone. While loading the MapViewController the
I need an advice what to do when my view controller is loading quite

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.