• 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

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 satoko on Fri 22 Jan 2010 at 16:15 with 0 comments