0

In the Apple contacts app, when you go to edit a contact, there are two fields labeled Street.

I am able to pull in the information from the first field with the following code:

ABMultiValueRef st = ABRecordCopyValue(addressBookRecord, kABPersonAddressProperty);
        if (ABMultiValueGetCount(st) > 0) {
            CFDictionaryRef dict = ABMultiValueCopyValueAtIndex(st, 0);
            self.addr1 = (__bridge NSString *)(CFDictionaryGetValue(dict, kABPersonAddressStreetKey));
        }

Can anyone tell me how to pull the info from the second field or otherwise shed light on what it is? There does not seem to be a specific key for it as there is for the first address field, city, state and zip

Thanks for any suggestions

user1904273
  • 4,562
  • 11
  • 45
  • 96

1 Answers1

0

For adding you can use:

[addressDictionary setObject:@"Street 1\nStreet 2" forKey:(NSString *)kABPersonAddressStreetKey];

For retrieving you can just:

NSString *street = [(NSString *)CFDictionaryGetValue(dict, kABPersonAddressStreetKey) copy];

This will give you the Street 1 and Street 2 strings

Spidy
  • 1,137
  • 3
  • 28
  • 48
Krify
  • 11
  • 3