如何获取特定联系人的组名

时间:2013-12-30 07:30:56

标签: ios xcode abaddressbook

我正在尝试获取特定联系人的群组名称。我尝试了以下代码

CFArrayRef allPeople = ABAddressBookCopyArrayOfAllPeople(addressBook);
CFIndex nPeople= ABAddressBookGetPersonCount(addressBook);
NSUInteger peopleCounter = 0;
for (peopleCounter = 0;peopleCounter < nPeople; peopleCounter++)
{
    ABRecordRef thisPerson = CFArrayGetValueAtIndex(allPeople,peopleCounter);
    NSString *strGroupName  = (__bridge NSString *)(ABRecordCopyValue(thisPerson, kABGroupNameProperty));
}

但它只是返回strGroupName中联系人的名字。

0 个答案:

没有答案