0

I am trying to save the unsaved contacts through ABAddressBook using the following code:

CFErrorRef error = NULL;
if (ABAddressBookHasUnsavedChanges(addressBook)) {
    ABAddressBookSave(addressBook, &error);
} else {
    ABAddressBookRevert(addressBook);
}

If I try to save about 1000 contacts, it is taking more than one minute to perform the action. I have run the code in Time Profiler and it reports 92% of total time elapsed singly on ABAddressBookSave.

Please help me reduce the time complexity of my code.

Sandeep Kumar
  • 611
  • 6
  • 7
  • Yes I have the same question.Do you solve the problem? – frank May 09 '14 at 09:27
  • I have put whole addressbook access and saving functionality of my application on different thread(i.e. dispatch_queue_async{}).So some performance is enhanced. Also logged an issue with apple developer and getting same response to use dispatch_queue, after one month of request. Hope it will help you! – Sandeep Kumar May 11 '14 at 08:44

1 Answers1

0

I have put whole addressbook access and saving functionality of my application on different thread(i.e. dispatch_queue_async{}).So some performance is enhanced. Also logged an issue with apple developer and getting same response to use dispatch_queue, after one month of request. Hope it will help you! –

Sandeep Kumar
  • 611
  • 6
  • 7