gpt4 book ai didi

iphone - ABAddressBookCopyArrayOfAllPeopleInSourceWithSortOrdering 的代码示例?

转载 作者:可可西里 更新时间:2023-11-01 03:35:51 25 4
gpt4 key购买 nike

有没有人有代码示例说明如何正确设置参数并使用 ABAddressBookCopyArrayOfAllPeopleInSourceWithSortOrdering() API 获取 iPhone 联系人列表的已排序子集?

最佳答案

以下应该有效:

ABAddressBookRef aB = ABAddressBookCreate();
ABRecordRef source = ABAddressBookCopyDefaultSource(aB); // or get the source with ABPersonCopySource(somePersonsABRecordRef);
NSArray *arr = (NSArray *)ABAddressBookCopyArrayOfAllPeopleInSourceWithSortOrdering(aB, source, kABPersonSortByLastName);
// you can also use kABPersonSortByFirstName instead of kABPersonSortByLastName

关于iphone - ABAddressBookCopyArrayOfAllPeopleInSourceWithSortOrdering 的代码示例?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4641229/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com