views:

221

answers:

3

Hi i am developing an app for my QA department. I need to programically get how many phone numbers are there in the entire address book. No user input. Just click a button and then get how many phonenumbers are there in the ENTIRE addressbook.

A: 

... Really? You guys are worried about me putting my email??? I have a question and you guys waste your time not even answering. Forget the email and please attempt to help me, please...?

Alan
A: 

from what I can tell from a quick look at ABMultiValue in AddressBook.sqlitedb, you might get it like this:

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

2 - SELECT value FROM ABMultiValue => into some array

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

look around for some more help doing these steps

Edit: there's probably also some way to do it with this method: http://stackoverflow.com/questions/1117575/how-do-you-get-a-persons-phone-number-from-the-address-book

1ace
+1  A: 

I think what you are looking for is ABGroupCopyArrayOfAllMembers. See the AddressBook Programming Guide and the QuickContacts example for more info on using the AB framework.

slf