ABAddressBookRef addressBook = ABAddressBookCreate();
CFArrayRef allPeople = ABAddressBookCopyArrayOfAllPeople(addressBook);
CFIndex nPeople = ABAddressBookGetPersonCount(addressBook);
NSMutableArray *masterList = [[NSMutableArray alloc] init];
for (int i = 0; i < nPeople; i++) {
ABRecordRef ref = CFArrayGetValueAtIndex(allPeople, i);
CFStringRef firstName = ABRecordCopyValue(ref, kABPersonFirstNameProperty);
CFStringRef lastName = ABRecordCopyValue(ref, kABPersonLastNameProperty);
NSString *contactFirstLast = [NSString stringWithFormat: @"%@", (NSString *)lastName];
CFRelease(firstName);
CFRelease(lastName);
[masterList addObject:contactFirstLast];
[contactFirstLast release];
}
self.list = masterList;
[masterList release];
iPhone读电话本
最新推荐文章于 2025-12-31 17:00:29 发布
1164

被折叠的 条评论
为什么被折叠?



