I have a text field with a contact name and I want to get the phone number for that:
ABAddressBookRef adressBook = ABAddressBookCreate();
NSArray *people = (NSArray *)ABAddressBookCopyPeopleWithName(adressBook,
CFStringCreateCopy(kCFAllocatorDefault,
(CFStringRef)recipient));
if((people != nil) && ([people count] == 1)){
ABMultiValueRef person = (ABMultiValueRef)[people objectAtIndex:0];
NSString *phone = (NSString *)ABRecordCopyValue(person,
kABPersonPhoneProperty) ;
NSLog(@"%@", phone);
}
I want the phone number as string but this gives me a lot more:
ABMultiValueRef 0x339470 with 1 value(s)
0: _$!<Mobile>!$_ (0x338c50) - 0177 1647788 (0x339450)
How to I get just the number as string?