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.
views:
221answers:
3... 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...?
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
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.