を持っている必要があります:
- (void)viewDidLoad
{
[super viewDidLoad];
ABAddressBookRef addressBook = ABAddressBookCreate();
if (addressBook != nil)
{
NSLog(@"Successfully accessed the address book.");
CFArrayRef arrayOfAllPeople = ABAddressBookCopyArrayOfAllPeople(addressBook);
if (arrayOfAllPeople != nil)
{
NSUInteger peopleCounter=0;
for (peopleCounter=0;peopleCounter<CFArrayGetCount(arrayOfAllPeople); peopleCounter++)
{
ABRecordRef thisPerson=CFArrayGetValueAtIndex(arrayOfAllPeople,peopleCounter);
NSLog(@"%@", thisPerson);
/* Use the [thisPerson] address book record */
}
CFRelease(arrayOfAllPeople);
}
/* if (allPeople != nil){ */
CFRelease(addressBook);
} /* if (addressBook != nil){ */
}