2011-05-25 63 views
0

从这个方法:- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person检索某人的地址。与iPhone联系人选择器

我怎样才能得到完整的街道地址+城市+国家和邮政编码......

感谢。

回答

1

从Apple文档:

ABRecordCopyValue 返回记录属性的值。

CFTypeRef ABRecordCopyValue (
    ABRecordRef record, 
    ABPropertyID property 
); 

参数

记录

包含有关财产的记录。

财产

记录的,其价值正在被归还的财产。请参阅ABPerson Reference中的“Constants”和ABGroup Reference中的“Constants”中的属性。

返回值

中的记录属性值。

所以你只要问你的ABRecord的具体属性,你应该没问题!

  • const ABPropertyID kABPersonAddressProperty;
  • const CFStringRef kABPersonAddressStreetKey;
  • const CFStringRef kABPersonAddressCityKey;
  • const CFStringRef kABPersonAddressStateKey;
  • const CFStringRef kABPersonAddressZIPKey;
  • const CFStringRef kABPersonAddressCountryKey;
  • const CFStringRef kABPersonAddressCountryCodeKey;
+0

谢谢朱利安,它工作正常! – Maxime 2011-08-17 14:44:36