Search By Number and Get the image using ABAddressBook

前端 未结 2 903
自闭症患者
自闭症患者 2020-12-25 09:04

I wish to search in the iphone AddressBook through my app using the number as the key and then retrieve the image associated to that contact and display it on the UIImageVie

2条回答
  •  长情又很酷
    2020-12-25 09:13

    -(void)fetchAddressBook:(NSString *)searchnumber
    {
        ABAddressBookRef UsersAddressBook = ABAddressBookCreateWithOptions(NULL, NULL);
    
        //contains details for all the contacts
        CFArrayRef ContactInfoArray = ABAddressBookCopyArrayOfAllPeople(UsersAddressBook);
    
        //get the total number of count of the users contact
        CFIndex numberofPeople = CFArrayGetCount(ContactInfoArray);
    
        //iterate through each record and add the value in the array
        for (int i =0; i

提交回复
热议问题