ABPeoplePicker选择并返回SELECTED电话号码

时间:2010-06-10 14:31:57

标签: iphone

  
      
  • (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)
  •   
     

peoplePicker         shouldContinueAfterSelectingPerson:(ABRecordRef)人

     

属性:(ABPropertyID)属性                                 标识符:(ABMultiValueIdentifier)标识符{}

是否可以返回电话号码或用户点击了一些?

1 个答案:

答案 0 :(得分:2)

 id value = [(id)ABRecordCopyValue(person, property) autorelease];

 if (ABPersonGetTypeOfProperty(property) & kABMultiValueMask)
    {
    CFIndex index = ABMultiValueGetIndexForIdentifier(
                        (ABMultiValueRef)value, identifier);

    value = [(id)ABMultiValueCopyValueAtIndex(
                        (ABMultiValueRef)value, index)
                        autorelease];
    }

 // show results to developer...
 NSString* firstname = ( NSString*)ABRecordCopyValue(
      person, kABPersonFirstNameProperty);
 NSLog(@" ~~~~~~~~~~~~~~~~~~~~ firstname is %@",firstname);
 NSLog(@" ~~~~~~~~~~~~~~~~~~~~ field clicked on: %@", value);