Question

My iPad app collects some user data, including name, address, phone, etc. I have a button that allows the user to create a new contact from this collected data.

Right now, my code creates a contact record (ABRecordRef) and sets some values (ABRecordSetValue). All the sample code I've found for the next step creates an ABUnknownPersonViewController and presents it in the existing navigationController.

I can get this all to work, but I don't want to use the navigationController, however when I present this in a modal view I don't know how to detect when the user has finished adding the contact once the Contacts page is shown. As well, I don't know why there are so many screens involved--I would like them to just hit my button and voila; the data is added as a Contact.

So, some questions:

  1. Do I need to present an ABUnknownPersonViewController or can I bypass all of that and just write the data out to the Address Book?

  2. If not, can I at least bypass one of the two screens presented (after the ABUnknownPersonViewController screen, a Contacts screen with edit ability is presented)?

  3. If I present the ABUnknownPersonViewController in a modal view can I detect when the Contacts page is finished so I can remove the view?

Thanks!

Was it helpful?

Solution

erdekhayser's comments put me on to the Apple docs which led me to this post here: How to add new contact to iOS Address Book?

This appears to be a good example of how to do this programatically.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top