ABContactHelper problem
some times not getting contacts count , shows contacts count to be zero even if i have contacts
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.
I am talking about address book contacts
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.
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 ??