I'm having trouble getting individual values from the AddressBook framework when the user selects a person from their contact list. I am presenting the standard contact picker view and when they pick a person using this code...
Code:
ABMultiValueRef multi = ABRecordCopyValue(person, kABPersonAddressProperty);
for (CFIndex i = 0; i < ABMultiValueGetCount(multi); i++) {
NSString *street = (NSString *)ABMultiValueCopyValueAtIndex(multi,i);
NSLog(@"street = %@",street);
}
CFRelease(multi);
This is the output of the log when I do this
Code:
street = {
City = Atlanta;
Country = USA;
CountryCode = ca;
State = GA;
Street = "3494 Kuhl Avenue";
ZIP = 30303;
}
That's great but I need to grab individual elements alone such as zip code or the street so how would I go about that. Is their a way to do this or should I just for loop through the string till I reach "ZIP" and get a substring after the equal sign after that to get zip. Thanks!