Search code examples
macoscocoaimportcontactsabaddressbook

cocoa osx mac pick contact from address book


In my application for mac I want to pick or import contacts from the address book list. I watched many post but are only for iOS. I know that in iOS you can display the contact list like this:

_addressBookController = [[ABPeoplePickerNavigationController alloc] init];
[_addressBookController setPeoplePickerDelegate:self];
[self presentViewController:_addressBookController animated:YES completion:nil]; 

enter image description here

How can I do this for mac?

Need help please. Thanks in advance.


Solution

  • It is built right into Interface Builder -- the class is ABPeoplePickerView which can be dragged into your xib like any other.

    https://developer.apple.com/library/mac/documentation/UserExperience/Conceptual/AddressBook/Tasks/AccessingData.html