Reputation: 436
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
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
Reputation: 4169
I needed it, so I started working on something like that. Check out https://github.com/stuffmc/MCFilteredPeoplePickerNavigationController
Upvotes: 3
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
Reputation: 31722
here is the good blog tutorial for extracting address book values,
try with below:
ABPeoplePickerNavigationController *peoplePicker = [[ABPeoplePickerNavigationController alloc] init];
[peoplePicker setPeoplePickerDelegate:self];
[peoplePicker setDisplayedProperties:[NSArray arrayWithObject:[NSNumber numberWithInt:kABPersonEmailProperty]]];
Upvotes: 2