views:

76

answers:

2

greetings!

when using peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person, a view with all of the contact's information is shown. I've seen apps which only display selected info only (e.g. phone numbers)

how can I do this? I only want to display the contact's name and phone numbers.

thank you very much

A: 

I'm not sure if you can,

You could do this to get a list of people for the address book:

// get the default address book. 
ABAddressBookRef addressBook = ABAddressBookCreate();

CFArrayRef allPeople = ABAddressBookCopyArrayOfAllPeople(addressBook);

and then create your own custom picker view, showing only the information you want.

Twelve47
+1  A: 

It's pretty simple. I customized ABPeoplePickerNavigationController to only show email addresses.

The code looks like this:

ABPeoplePickerNavigationController *peoplePicker = [[ABPeoplePickerNavigationController alloc] init];
    [peoplePicker setPeoplePickerDelegate:self];
    [peoplePicker setDisplayedProperties:[NSArray arrayWithObject:[NSNumber numberWithInt:kABPersonEmailProperty]]];

You can find a list of the available properties here.

Jamie Pinkham