smtlaissezfaire
smtlaissezfaire

Reputation: 436

Filtering out email addresses from ABPeoplePickerNavigationController

I'm using ABPeoplePicker to show a list of contacts.

I'd like to filter this list of contacts to only show the contacts that have email addresses. How would I do so?

Upvotes: 7

Views: 2618

Answers (4)

Erhannis
Erhannis

Reputation: 4462

I'm trying to do a similar thing. I've gotten an instance of ABAddressBook, removed the entries I don't want, then set picker.addressBook = filteredBook. It...KINDA works. The list seems to be filtered, but entries are duplicated like it expects the full list to be there and it just copies existing entries until it has the expected count, or something.

Upvotes: 0

StuFF mc
StuFF mc

Reputation: 4169

I needed it, so I started working on something like that. Check out https://github.com/stuffmc/MCFilteredPeoplePickerNavigationController

Upvotes: 3

Toby Allen
Toby Allen

Reputation: 11213

ABContactHelper is a greater wrapper for the Addressbook and has some methods for filtering contacts based on various things.

https://github.com/erica/ABContactHelper

Upvotes: 0

Jhaliya - Praveen Sharma
Jhaliya - Praveen Sharma

Reputation: 31722

here is the good blog tutorial for extracting address book values,

http://blog.slaunchaman.com/2009/01/21/cocoa-touch-tutorial-extract-address-book-address-values-on-iphone-os/

try with below:

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

Upvotes: 2

Related Questions