I have written code as below for removing all contacts from addressbook. But it works very slow for more then 1000 contacts. is there any other way for removing all contacts from addressbook. I needs that for restoring backup in my application.
-(void)removeAllData
{
ABAddressBook *book = [ABAddressBook sharedAddressBook];
int count = [[book people] count];
for(int i=count;i>=0;i--)
{
if(i<[[book people] count])
{
[book removeRecord:[[book people] objectAtIndex:i]];
}
}
[book save];
}