名字,姓氏和电子邮件地址非常棒!一旦我得到解决,我就崩溃了。
NSString *firstName = (NSString *)ABRecordCopyValue(thisPerson, kABPersonFirstNameProperty);
NSString *lastName = (NSString *)ABRecordCopyValue(thisPerson, kABPersonLastNameProperty);
NSString *emailAddress = (NSString *)ABRecordCopyValue(thisPerson, kABPersonEmailProperty);
NSString *address = (NSString *)ABRecordCopyValue(thisPerson, kABPersonAddressStreetKey);
NSString *city = (NSString *)ABRecordCopyValue(thisPerson, kABPersonAddressCityKey);
NSString *state = (NSString *)ABRecordCopyValue(thisPerson, kABPersonAddressStreetKey);
NSString *zip = (NSString *)ABRecordCopyValue(thisPerson, kABPersonAddressZIPKey);
答案 0 :(得分:2)
地址是MultiValue属性((a multivalue property of type kABMultiDictionaryPropertyType
),您不能使用ABRecordRef
对象直接访问它。
您首先需要获取该多值属性,然后使用此属性可以访问街道,城市和其他地址属性。