用 显示人员选择器ABPeoplePickerNavigationController
,我可以通过以下方式在字典中获取所选人员的地址:
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier {
if (property == kABPersonAddressProperty) {
ABMultiValueRef addressMultiValue = ABRecordCopyValue(person, kABPersonAddressProperty);
NSDictionary *address = (NSDictionary *)CFBridgingRelease(ABMultiValueCopyValueAtIndex(addressMultiValue, ABMultiValueGetIndexForIdentifier(addressMultiValue, identifier)));
}
[self dismissModalViewControllerAnimated:YES];
return NO;
}
根据国家/地区的不同,有关如何格式化此地址的约定是不一样的。
有没有办法获取选择器显示的地址字符串(类似于 Contacts.app 显示的内容)?