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

  • Home
  • SEARCH
  • 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 8997407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:53:08+00:00 2026-06-15T23:53:08+00:00

I need help with a custom AddressBook (ABPeoplePickerViewController) for iPhone? I want to have

  • 0

I need help with a custom AddressBook (ABPeoplePickerViewController) for iPhone?
I want to have an array with all my contacts, pulling just their name and numbers into the cells of the tableview to display.. Select a few contacts, open Messages and send them a Text/SMS with a custom message..

WhatsApp messenger is an awesome example, if you go to Settings, Tell a Friend, then Message..
I want that look!

Contacts Pickerview
It must be custom as I also want the Send and Cancel buttons below, and Name in cell.textLabel and their number in the cell.detailTextLabel in a Subtitle style tableview.

So how do I get their details from addressbook and into my arrays (contactsName, contactsNumber)? Thanks in advance! Here is my code:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [_tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
    cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
    }

    cell.textLabel.text = [contactsName objectAtIndex:indexPath.row];
    cell.detailTextLabel.text = [contactsNumber objectAtIndex:indexPath.row];

    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
}

- (void)peoplePickerNavigationControllerDidCancel:(ABPeoplePickerNavigationController *)peoplePicker
{
    [self dismissViewControllerAnimated:YES completion:^{ NSLog(@"Message controller has been canceled"); }];
}

- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person
{
    NSString *name = (__bridge_transfer NSString*)ABRecordCopyValue(person, kABPersonFirstNameProperty);
    NSString *number = (__bridge_transfer NSString*)ABRecordCopyValue(person, kABPersonPhoneProperty);
    NSLog(@"Name: %@ Number: %@", name, number);

    return NO;
}

- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier
{
    return NO;
}

- (void)openSMScontroller {
    MFMessageComposeViewController *smsView = [[MFMessageComposeViewController alloc] init];
    smsView.messageComposeDelegate = self;

    smsView.recipients = [NSArray arrayWithArray:contactsNumber];
    smsView.body = @"Check out this awesome app!";

    [self presentModalViewController:smsView animated:YES];
}
  • 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-15T23:53:09+00:00Added an answer on June 15, 2026 at 11:53 pm

    you can get what you want from addressbook by below code my friend.!!!!!

    happy coding!!!!!!

    - (BOOL)peoplePickerNavigationController: (ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person {
     ABMultiValueRef phoneNumbers = ABRecordCopyValue(person, kABPersonPhoneProperty);
       ABMultiValueRef addressProperty = ABRecordCopyValue(person, kABPersonAddressProperty);
     NSArray *address = (NSArray *)ABMultiValueCopyArrayOfAllValues(addressProperty);
    if([address count] > 0)
    {
        for (NSDictionary *addressDict in address)
        {
            countrytf.text = [addressDict objectForKey:@"Country"];
            streetaddresstf.text = [addressDict objectForKey:@"Street"];
            citynametf.text = [addressDict objectForKey:@"City"];
            statenametf.text = [addressDict objectForKey:@"State"];
            zipcodetf.text = [addressDict objectForKey:@"ZIP"];
    
        }
        CFRelease(addressProperty);
    }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i need help, i have some data coming in xml, i want to make
I need help with an custom Image-Button that i have used for a while.
I need help with custom url in MVC3. I have a news table and
I need help writing custom functions for my casio fx-9860g I have done this
I need help. I have custom uitableviewcell with uiscrollview inside, I iterate over an
I'm working on a custom filter in WordPress and just need help sorting this
I need help. I want to validate form input with custom validator in Spring
Just need some help with this. I have written a WCF service which passes
I have an array of objects of my custom class and i want to
I need a help about creating custom wpf controls.I want to create a template

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.