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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:16:20+00:00 2026-05-16T00:16:20+00:00

I am newbie to Address book programming. I want to retrieve all email id’s

  • 0

I am newbie to Address book programming. I want to retrieve all email id’s from address book.The issue is below code gets the all data for one record(one person). but When i add more than one contact in address book. it crushes without showing any exception.

Any suggestions? Thanks in advance.

   self.pastUrls = [[NSMutableArray alloc] init];


ABAddressBookRef addressBook = ABAddressBookCreate();

NSArray *addresses = (NSArray *) ABAddressBookCopyArrayOfAllPeople(addressBook);

// you could probably do some kind of enumeration but I'm doing old fashoined way
int i;
for(i = 0; i < [addresses count]; i++) {
    ABRecordRef record = [addresses objectAtIndex:i];


    ABMultiValueRef multiValue = ABRecordCopyValue(record, kABPersonEmailProperty);
    NSLog(@"%@",multiValue);

    int count = ABMultiValueGetCount(multiValue);
    NSLog(@"%d",count);
    int j;
    for(j = 0; j < count; j++) {
        NSString *label = (NSString *)ABAddressBookCopyLocalizedLabel(ABMultiValueCopyLabelAtIndex(multiValue, i));
        NSString *value = (NSString *)ABMultiValueCopyValueAtIndex(multiValue, i);

        //NSLog(@"Email for %@: %@", label, value);
        [pastUrls addObject:value];


    }
}

Regards,
sathish

  • 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-16T00:16:21+00:00Added an answer on May 16, 2026 at 12:16 am

    There are a couple of online tutorials here that should help:

    http://iphone.zcentric.com/2008/09/19/access-the-address-book/

    https://developer.apple.com/iphone/library/documentation/ContactData/Conceptual/AddressBookProgrammingGuideforiPhone/100-Introduction/Introduction.html

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

Sidebar

Related Questions

I am a newbie in C++ programming and trying to learn the language from
I'm newbie to BSD socket programming in C. I can query a web address
I have a newbie question. The Ruby code below returns JSON shown in Output1.
I'm a newbie to shell programming and I'd like to find the IP address
newbie here. I successfully created a chat server using c# (server partial code below,
newbie for clearcase. Since clearcase's config is rather different from other concept in git,
Newbie question since I'm not up to speed using maven at all. I'm trying
Possible Duplicate: Validate email address in Javascript? Can anyone help me with email validation
I'm a total newbie for database-based website. I just learned designing website from zero
I want that whenver a user inserts www. in a comment textarea, the address

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.