ABAddressBookCopyArrayOfAllPeople and ABAddressBookGetPersonCount return different sizes

前端 未结 3 1899
孤独总比滥情好
孤独总比滥情好 2021-01-02 20:17

I have an app which crashes occasionally due to the array returned by ABAddressBookCopyArrayOfAllPeopleInSourceWithSortOrdering() having a different size to ABAddressBookGet

3条回答
  •  青春惊慌失措
    2021-01-02 21:11

    ABAddressBookGetPersonCount And ABAddressBookCopyArrayOfAllPeople gives different arrays.

    ABAddressBookGetPersonCount - Returns the number of person records in an address book. ABAddressBookCopyArrayOfAllPeople - Returns all the person records in an address book.

    So some times same person may have extra records. That's why you may getting different sizes.

提交回复
热议问题