0

The firstname, lastname and email address work great! as soon as I get to address, im crashing.

            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);
Cocoa Dev
  • 9,361
  • 31
  • 109
  • 177

1 Answers1

2

Address is MultiValue Property ((a multivalue property of type kABMultiDictionaryPropertyType) you can not access it like this directly using ABRecordRef object.

You first need to get that multivalue property and then using this you can access the street,city and other address properties.

Ravin
  • 8,544
  • 3
  • 20
  • 19