Ich bin derzeit in der Lage, erfolgreich auf Daten aus der Datenbank zuzugreifen und diese abzurufen. peoplePickerNavigationController
Ich möchte jedoch die E-Mail-Adresse des Kontakts aufrufen und das modale Fenster schließen, wenn der Kontaktname gedrückt wird.
Szenario:
"Button is clicked to add a contact
AddressBook Modal Window slides into view
Name of Contact is pressed
If available, the contact's email address is stored in an array
Dismiss modal window"
Mein derzeitiger Code besteht aus:
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier {
ABMultiValueRef container = ABRecordCopyValue(person, property);
CFStringRef contactData = ABMultiValueCopyValueAtIndex(container, identifier);
CFRelease(container);
NSString *contactString = [NSString stringWithString:(NSString *)contactData];
CFRelease(contactData);
NSLog(@"Value is: %@", contactString);
[self dismissModalViewControllerAnimated:YES];
return NO;
}