ABPeoplePicker select and return SELECTED phone number
Under
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)
peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person开发者_StackOverflow中文版
property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier{}
is it possible to get returned the phone number or somewhat the user has clicked?
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);
精彩评论