I am trying to search the AddressBook for Phone Numbers by name,
-(void)textMessage{
ABAddressBookRef addressBook = ABAddressBookCreate();
NSMutableArray *array;
for(int i = 0;i<[savedPeople count];i++){
array = [[[NSMutableArray alloc]initWithArray:savedPeople]objectAtIndex:i];
CFArrayRef people = ABAddressBookCopyPeopleWithName(addressBook, (CFStringRef)array);
NSLog(@"%@",people);
}
}
and i get a log of this
2012-05-01 09:22:31.688 UpOut[5829:15803] (
"<CPRecord: 0x84edf90 ABPerson>"
)
2012-05-01 09:22:31.694 UpOut[5829:15803] (
"<CPRecord: 0x84ee1c0 ABPerson>"
)
I dont know what the string in the middle mean, did it return correctly??
EDIT
for(NSString *name in savedPeople){
CFArrayRef people = ABAddressBookCopyPeopleWithName(addressBook, (CFStringRef)name);
CFTypeRef phoneProperty = ABRecordCopyValue((ABRecordRef)people, kABPersonPhoneProperty);
NSLog(@"%@",phoneProperty);
}