How to tell ABPeoplePickerNavigationController to list only contacts that have an email address?

前端 未结 2 1018
心在旅途
心在旅途 2021-01-18 13:18

I want my users to fill an email field by selecting a contact\'s email from their address books. I don\'t want them to scroll all the contacts whose emails are not set, so I

2条回答
  •  心在旅途
    2021-01-18 14:03

    I do not believe there is a way to get iOS to do this filtering. I do it in code too. Note that you need to look for all kinds of email addresses - you have to iterate through the dictionary that you can get. Working with this is a PITA for sure - I've done it before - and you have to be careful to not have memory leaks.

    What I do is as you suggest - iterate through all contact myself, then I pop a view with a table and let then select the names of the people they want. I keep an association around so I know what address is associated with what name, then use the system email framework and then populate the send-to addresses.

提交回复
热议问题