IPhone sdk: How to get the count of all phone numbers in the address book?

Hi, I am developing an application for my QA department. I need to program the number of phone numbers in the entire address book. No user input. Just press the button and then indicate how many phonenumbers are in the ENTREbook.

+2


source to share


2 answers


I think you are looking for ABGroupCopyArrayOfAllMembers . See the Address Book Programming Guide and QuickContacts example for more information on using the AB structure.



+1


source


from what I can tell by looking quickly ABMultiValue

in AddressBook.sqlitedb

, you can get it like this:

1 - sqlite before /var/mobile/Library/AddressBook/AddressBook.sqlitedb

2 - SELECT value FROM ABMultiValue

=> to some array



3 - count everything that matches /^[0-9 +]+$/

look around to help you with this.

Edit: There might also be a way to do it with this method: How do you get the person's phone number from the address book?

0


source







All Articles