아이폰2013. 1. 18. 23:48

글을 올린 블로거를 생각해서 광고 한번만 클릭해주시면 감사하겠습니다

ABAddressBookRef addressBook = ABAddressBookCreate();

CFArrayRef people = ABAddressBookCopyArrayOfAllPeople(addressBook);

CFMutableArrayRef peopleMutable = CFArrayCreateMutableCopy(

kCFAllocatorDefault,

CFArrayGetCount(people),

people

);

CFArraySortValues(

peopleMutable,

CFRangeMake(0, CFArrayGetCount(peopleMutable)),

(CFComparatorFunction) ABPersonComparePeopleByName,

(void*) ABPersonGetSortOrdering()

);

CFRelease(addressBook);

CFRelease(people);

CFRelease(peopleMutable);

출처 : http://samse.tistory.com/entry/Programatically-access-to-iOS-AddressBook-database

Posted by 퍼플카우D