I have a sort function that sorts the Address book by Last Name, I need to modify this code so that it will sort by first Name. Where do I need to make change in this code. I know its a simple change but I am unable to figure it out. This is the code that sorts the contacts list by Last Name
ABAddressBookRef addressBook = ABAddressBookCreate();
CFArrayRef people = ABAddressBookCopyArrayOfAllPeople(addressBook);
CFMutableArrayRef peopleMutable = CFArrayCreateMutableCopy
(
kCFAllocatorDefault,
CFArrayGetCount(people),
people
);
CFArraySortValues
(
peopleMutable,
CFRangeMake(0, CFArrayGetCount(peopleMutable)),
(CFComparatorFunction) ABPersonComparePeopleByName,
(void*) ABPersonGetSortOrdering()
);