0

I have read contacts from Address Book and display the list of contacts. By clicking any contact user can view its whole details, and all is working fine. Now i want to give "Edit" functionality to my users, i do not get the way to do it? Plz help via coding example? Here is some more detail: i have 3 buttons, one to show contacts, second to edit and third named "save" to save edited changes against that contact.

Bundle of Thanks

Rahul Vyas
  • 28,260
  • 49
  • 182
  • 256

1 Answers1

4

Read addressbook programming guide. Here is a tutorial to get the address book contacts

http://iphone.zcentric.com/2008/09/19/access-the-address-book/

here is a sample on apple site see if it works for you

https://developer.apple.com/library/ios/#samplecode/QuickContacts/Introduction/Intro.html#//apple_ref/doc/uid/DTS40009475

Rahul Vyas
  • 28,260
  • 49
  • 182
  • 256
  • thanx for reply but i am not having a problem to read contacts instead i am not able to modify/change them:( (e.g lastname etc) – iPhone Developer Jun 24 '11 at 12:00
  • @iPhone Developer I have tested the sample code and it's working you can edit contact. Just create a contact named "Appleseed" in simulator contacts app. and run the sample code. – Rahul Vyas Jun 24 '11 at 12:24
  • Thanx Rahul:) sorry due to the weekend i wasn't able to reply. yup the app was helpful but there is a problem that it only read and edit contacts that are in its address book as not reading from my address book. As i have added contacts in my address book and then downloaded the app and run it but it wasn't able to read them then i added contacts in its address book so then it was working fine:( can u help me to fix it? i want that it will read contact of the address book where it is installed Thanx alot for help and quick response:) – iPhone Developer Jun 27 '11 at 08:11
  • @iPhone Developer you need to use SQliteDatabase for your requirement. Use FMDB for your sqlite purpose. I assume you want add/edit contact functionality in your application. So Sqlite is one way to achieve what you want. – Rahul Vyas Jun 27 '11 at 10:06
  • Nop, its not the way that i want:( In simple words, i need functionality of the "sample App" at above link (given by u i.e. 2nd link) is giving. Means the above app is according to my requirements the only problem is it is not reading contacts from my address book instead added in it:( I don't have any need to maintain any database as my contacts are in address book, i am reading them from there, now just want to edit them and want these changes in address book, so that instead user will edit that contact from address book can edit using my app. Sorry for inconvenience – iPhone Developer Jun 27 '11 at 11:02
  • ok. you need to modify edit functionality of the demo app I have given you link of. In the demo app apple's is passing a name for that contact to edit. you can just modify that code to your requirement. like if user taps on a cell get the name of that contact and open it for editing. I hope you understand. – Rahul Vyas Jun 27 '11 at 11:10