我正在使用
NSMutableArray *people = [[[(NSArray*)ABAddressBookCopyArrayOfAllPeople(addressBook) autorelease] mutableCopy] autorelease];
访问地址簿。 现在我想从Exchange Server访问特定的Addressbook组。 这可能吗?
答案 0 :(得分:1)
你不需要这样的事情。
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`