如何从iphone中的地址簿中检索联系人的街道,城市,州和国家
答案 0 :(得分:1)
您可以使用ABAddressBook框架。 看看@ http://developer.apple.com/library/mac/#documentation/UserExperience/Reference/AddressBook/Classes/ABAddressBook_Class/Reference/Reference.html
答案 1 :(得分:1)
ABAddressBookRef addressBook = ABAddressBookCreate();
NSArray *array= (NSArray *)ABAddressBookCopyArrayOfAllPeople(addressBook);
ABRecordRef person=(ABRecordRef)[array objectAtIndex:i];
firstName=(NSString *)ABRecordCopyValue(person, kABPersonFirstNameProperty);
lastName=(NSString *)ABRecordCopyValue(person, kABPersonLastNameProperty);
streeName = (NSString *)ABRecordCopyValue(person, kABPersonAddressStreetKey);
ciy = (NSString *)ABRecordCopyValue(person, kABPersonAddressCityKey);
不要忘记添加Address Book和AddressBook框架。