开发者

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 tha开发者_如何学运维t have email addresses. How would I do so?


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


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]]];


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

https://github.com/erica/ABContactHelper


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜