Can we access the emailids from the contactlist from iPhone?

前端 未结 2 1876
星月不相逢
星月不相逢 2021-02-01 11:33

Can we access all the email IDs for each contact from the iPhone contactlist through code?

2条回答
  •  有刺的猬
    2021-02-01 12:10

    Sure, use the ABAdressBook class:

    ABAddressBookRef addressBook = ABAddressBookCreate(); NSArray *allPeople = (NSArray *)ABAddressBookCopyArrayOfAllPeople(addressBook);

    Now you have all contacts in the allPeople array, then just get the email by key.

提交回复
热议问题