ABMultiValueCopyValueAtIndexの二つ目にいつもidentfierを渡したんですが、バグてました。メモメモ。
ABMultiValueGetIndexForIdentifierでidentifierをindexに直してやる必要があります。
rails>>
(BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier {
CFTypeRef list;
CFIndex index;
CFStringRef email;list = ABRecordCopyValue(person, property);
index = ABMultiValueGetIndexForIdentifier(list, identifier);
email = ABMultiValueCopyValueAtIndex(list, index);
(中略)CFRelease(email);
CFRelease(list);
<<--
via http://stackoverflow.com/questions/1875135/get-email-address-from-iphone-address-book
posted by
satoko on Fri 22 Jan 2010 at 16:15 with 0 comments