0

I am using the following code to get the contacts from the User's Phone

CFErrorRef  error;
__block BOOL accessGranted;
ABAddressBookRef myAddressBook = ABAddressBookCreateWithOptions(NULL,&error);
ABAddressBookRequestAccessWithCompletion(myAddressBook, ^(bool granted, CFErrorRef error) 

{
if (!accessGranted && !granted)
{
alertViewDeny = [[UIAlertView alloc]initWithTitle:@"Deny Access" message:@"Deny" delegate:self cancelButtonTitle:nil otherButtonTitles:@"cancel", nil];
[alertViewDeny show];
[alertViewDeny release];
}
else
{
NSArray *allPeople = (NSArray *)ABAddressBookCopyArrayOfAllPeople(myAddressBook);


   DLog(@"allPeople %@",allPeople);
}

In Output I am getting //Only for iOS7 and it is working iOS6.

allPeople( )

Baby Groot
  • 4,637
  • 39
  • 52
  • 71
iOSDev
  • 412
  • 10
  • 30

0 Answers0