0

Below code does not work on iOS 11 , ABAddressBookCopyPeopleWithName works on iOS 9 but does not work on iOS 11.

(void)showPersonViewController
    {
        NSString *cf = [self.data.displayName copy];
        NSArray *people = (NSArray *)CFBridgingRelease(ABAddressBookCopyPeopleWithName(self.addressBook, (__bridge CFStringRef)cf));
        if ((people != nil) && [people count])
        {
        }
        else
        {
        }
    }
rmaddy
  • 314,917
  • 42
  • 532
  • 579
  • The old AddressBook framework was deprecated a few years ago. You really should be using the newer Contacts framework added in iOS 9.0. – rmaddy Nov 10 '17 at 15:14
  • Only use AddressBook framework if you need to support iOS versions prior to iOS 9. But in answer to your question, did you add the Info.plist settings for access to address book? Did you request (and receive) permission to use address book? – Rob Nov 10 '17 at 15:38
  • yes I did, please provide the sample code for using Contacts framework. – Mahesh India Nov 20 '17 at 21:09

0 Answers0