2

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.

slf
  • 22,595
  • 11
  • 77
  • 101
ALAN
  • 21
  • 1
  • I've never seen someone drop their email in to the question. Is this allowed? I don't see why not but I find it odd.... – Frank V Apr 12 '10 at 15:01
  • I agree, odd and probably not compatible with the nature of SO... It should probably be removed from the question – code_burgar Apr 12 '10 at 15:03
  • Email addresses in questions, duplicate user accounts, posting comments as answers. Not a good start, really. Have a look here: http://stackoverflow.com/faq – Robert Harvey Mar 11 '11 at 00:11

2 Answers2

1

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
  • 22,595
  • 11
  • 77
  • 101
0

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: How do you get a persons phone number from the address book?

Community
  • 1
  • 1
1ace
  • 5,272
  • 4
  • 23
  • 30