I have implemented method to get contacts.
For iOS 6, I used below code to get permission from the user:
CFErrorRef myError = NULL;
ABAddressBookRef myAddressBook = ABAddressBookCreateWithOptions(NULL, &myError);
ABAddressBookRequestAccessWithCompletion(myAddressBook,^(bool granted, CFErrorRef error)
{
if(granted)
{
[self GetContactInformation];
}
else
{
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Contacts" message:@"You didn't permit us to access your contact details." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil];
[alert show];
[alert release];
}
});
CFRelease(myAddressBook);
Above code working fine in iOS 6 but below iOS 6 I am getting below error: