1

I want to read contact list and edit all phone numbers. For example , find all number by prefix (511) and change it by (513). For read all contacts, I find this code (and it works fine):

Fetch Contacts in iOS 7

But for edit contact , I couldn't find anything. Can any one help me? Thanks

Community
  • 1
  • 1
ali shekari
  • 740
  • 1
  • 11
  • 26
  • AFAIK, you are not allowed to edit contacts, let alone *batch* edit contacts. – duci9y Jul 26 '14 at 06:13
  • @duci9y is right. The only way I could handle updates, was to find the old contact, delete it, and insert a new one to the address book. – n00bProgrammer Jul 26 '14 at 06:16
  • 1
    Of course you can edit contacts. Do a search. There are plenty of existing topics showing how. – rmaddy Jul 26 '14 at 07:01
  • Yes you can edit the contact. – Mohit Jul 26 '14 at 07:48
  • I retract from my previous comment. Just tried, and it works. Will post some sample code as soon as I can. – n00bProgrammer Jul 26 '14 at 09:38
  • Just one question. How are you deciding which contacts to edit? I mean, you only plan to edit numbers that have been inserted by **you**, because editing ALL contacts in the address book is wrong. Do you insert contacts in a specific address group (`ABGroup`) or keep a list of inserted contacts with their record id (`ABRecord`)? – n00bProgrammer Jul 26 '14 at 09:43
  • one problem! This top answer remove added phone numbers. And only save last number in contacts for me!And not solved my problem. – ali shekari Jul 27 '14 at 08:47

0 Answers0