tags:

views:

453

answers:

1

With the AddressBook API, the only way to get a list of all of the people seems to be via 'ABAddressBookCopyArrayOfAllPeople' if you're not using 'ABPeoplePickerNavigationController'.

ABPeoplePickerNavigationController's pick a person and dismiss the view behavior is not what I need. Instead, what I'd like to do is load the address book contents into my own table view and then do some custom selection behavior.

But is there any way to deal with partially loading the address book data instead of the entire list to supply the data as a the table's data source? If say the address book contained 3000 entries, then I'm copying all of that data into a local array -- is there a more optimal way around this to achieve better performance?

A: 

Not sure its optimal but if you seek to show all the content in your table, it must be "sorted" somehow, suppose you simple sort it alphabetically, then you can instead of copy all the addressbook just ask for it to return a list of records starting with "a" the method for this is I think: CFArrayRef ABAddressBookCopyPeopleWithName ( ABAddressBookRef addressBook, CFStringRef name ); name can be a "a*" which would return all people starting with a. multiple calls to this method from your table could be used to avoid copying all people I think.

hope this helps, -t

Tzur