Click here to Skip to main content
15,867,704 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I Want To Open Apple's Inbuilt Contact Book On Button Click. I Have Tried Some Other Codes, But It Didn't Works I Have Added 4 Libraries In My Project

Please Help Me Out Thanx in Advance
Posted
Comments
Richard MacCutchan 2-Jan-16 3:39am    
What does "didn't work" mean?

1 solution

It's Sorry To Say But I Got Solution and It's Here.

Please try this code to open default contact list and manage this list by its delegate methods:

ABPeoplePickerNavigationController *picker =
    [[ABPeoplePickerNavigationController alloc] init];
    picker.peoplePickerDelegate = self;
    picker.predicateForEnablingPerson = [NSPredicate predicateWithFormat:@"%K.@count > 0", ABPersonPhoneNumbersProperty];

    [self.navigationController presentViewController:picker animated:YES completion:nil];


And don't forget to import addressbook frameworks and its delegates in you view controller.

#import <AddressBookUI/AddressBookUI.h>
#import <AddressBook/AddressBook.h> 


Delegate :

ABPeoplePickerNavigationControllerDelegate
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900