gpt4 book ai didi

ios - 访问特定的 AB 地址簿组

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:27:38 27 4
gpt4 key购买 nike

我正在使用

NSMutableArray *people = [[[(NSArray*)ABAddressBookCopyArrayOfAllPeople(addressBook) autorelease] mutableCopy] autorelease]; 

访问地址簿。现在我想从 Exchange 服务器访问特定的地址簿组。这可能吗?

最佳答案

你不需要做这样的事情。

ABRecordRef exchange = ABAddressBookGetSourceWithRecordID(addressBook, kABSourceTypeExchange);
CFArrayRef groups = ABAddressBookCopyArrayOfAllGroupsInSource(addressBook, exchange);

CFArrayRef officePersonnel;
for (ABRecordRef group in (NSArray *)groups) {
CFStringRef groupName = ABRecordCopyValue(group, kABGroupNameProperty, NULL);
if ( CFStringFind(groupName, CFSTR("Office"), kCFCompareCaseInsensitive) != kCFNotFound ) {
officePersonnel = ABGroupCopyArrayOfAllMembers(group);
}
CFRelease(groupName);
}

CFRelease(groups);

// Use and later release `officePersonnel`

关于ios - 访问特定的 AB 地址簿组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6278834/

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