我想获取 iPhone 的所有联系人列表.
I want to get a list of all contacts of an iPhone.
我检查了 通讯录
参考,我可能遗漏了一些东西,但我没有看到它提供了获取联系人列表的方法.
I checked Address Book
reference, I may missed something but I didn't see it provides a method to get a list of contacts.
也许是 ABPerson
函数 ABAddressBookCopyArrayOfAllPeople 可以吗?
Perhaps ABPerson
function ABAddressBookCopyArrayOfAllPeople might do?
示例:
ABAddressBookRef addressBook = ABAddressBookCreate( );
CFArrayRef allPeople = ABAddressBookCopyArrayOfAllPeople( addressBook );
CFIndex nPeople = ABAddressBookGetPersonCount( addressBook );
for ( int i = 0; i < nPeople; i++ )
{
ABRecordRef ref = CFArrayGetValueAtIndex( allPeople, i );
...
}
这篇关于获取 iOS 上所有联系人的列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!