我正在尝试获取特定联系人的群组名称。我尝试了以下代码
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中联系人的名字。