I am able to get the phone no of any contact from following code
NSLog(@"%@",ABMultiValueCopyValueAtIndex(ABRecordCopyValue(ref,kABPersonPhoneProperty) ,0));
NSLog(@"%@",ABMultiValueCopyValueAtIndex(ABRecordCopyValue(ref,kABPersonPhoneProperty) ,1));
NSLog(@"%@",ABMultiValueCopyValueAtIndex(ABRecordCopyValue(re开发者_运维问答f,kABPersonPhoneProperty) ,2));
NSLog(@"%@",ABMultiValueCopyValueAtIndex(ABRecordCopyValue(ref,kABPersonPhoneProperty) ,3));
NSLog(@"%@",ABMultiValueCopyValueAtIndex(ABRecordCopyValue(ref,kABPersonPhoneProperty) ,4));
but from above code I does not identify which phone number is related to which one (for ex- mobile, home, main, iPhone etc).
Please suggest how can I identify the type of any number?
Try ABMultiValueCopyLabelAtIndex, this will give you the type of the phone number
ABMultiValueRef phoneProperty = ABRecordCopyValue(person,kABPersonPhoneProperty);
for(int i=0;i<[array count];i++)
{
NSString* phoneLabel = (NSString*) ABAddressBookCopyLocalizedLabel(ABMultiValueCopyValueAtIndex(phoneProperty,i)
NSLog(@"%@",phoneLabel);
}
精彩评论