ABContactHelper icon indicating copy to clipboard operation
ABContactHelper copied to clipboard

ABContactHelper problem

Open malathiP opened this issue 11 years ago • 4 comments

some times not getting contacts count , shows contacts count to be zero even if i have contacts

malathiP avatar Feb 24 '14 06:02 malathiP

Please use the helper in the iOS 6 cookbook repo. Thanks.

-- E

On Feb 23, 2014, at 11:35 PM, malathiP [email protected] wrote:

some times not getting contacts count , shows contacts count to be zero even if i have contacts

— Reply to this email directly or view it on GitHub.

erica avatar Feb 24 '14 15:02 erica

I am talking about address book contacts

malathiP avatar Feb 25 '14 06:02 malathiP

And I am too!

https://github.com/erica/iOS-6-Advanced-Cookbook/tree/master/C09%20-%20Address%20Book

:)

-- Erica

On Feb 24, 2014, at 11:16 PM, malathiP [email protected] wrote:

I am talking about address book contacts

— Reply to this email directly or view it on GitHub.

erica avatar Feb 25 '14 14:02 erica

Yes i got it, but what is the reason not getting contacts in previous

  • (BOOL)testContacts { CFErrorRef error = NULL;

    ABAddressBookRef addressBook = ABAddressBookCreateWithOptions(NULL, &error); if (addressBook != nil) { NSLog(@"Succesful.");

    NSArray *allContacts = (__bridge_transfer NSArray
                            *)ABAddressBookCopyArrayOfAllPeople(addressBook);
    

    if(allContacts.count > 0) return YES; else return NO; } return NO; }

    while([ABContactsHelper contacts] > 0) { NSLog(@"TRUE"); }

      NSLog(@"FALSE");
    

i am just testing like this, but this code doesn't work some times not getting contacts. do you have any idea ??

malathiP avatar Feb 26 '14 07:02 malathiP