conmulligan
conmulligan

Reputation: 7148

On iPhone OS, how can I programmatically check if a contact exists in the address book?

I've added a feature to my app that allows the user to save a business's contact details to the address book; however, to guard against adding multiple entries I want to check that the entry doesn't already exist.

Any idea how to do this? The iPhone developer documentation seems a little unclear. I'm using the C api to add the contact.

Upvotes: 2

Views: 1508

Answers (1)

Ben Gottlieb
Ben Gottlieb

Reputation: 85542

Use ABAddressBookCopyPeopleWithName() to fetch a list of potential matches from the Address Book, and then iterate through them to see if they're the name you're adding.

Upvotes: 5

Related Questions