Just like the
MPMediaPickerController class in the preceding
section, and the other classes we met earlier in the book, Apple has provided an
ABPeoplePickerNavigationController and associated delegate protocol to allow you to both prompt
the user for contact information and display contact information to the
user. However, in this case the framework it provides also allows your
application to interact with person and group records directly.
Once you reach the lower levels of the Address Book framework—for instance, dealing with individual person records—the interface presented by the framework is in C rather than Objective-C. This is especially obvious when dealing with the address book programmatically rather than interactively using the navigation controller.
To illustrate how to use the
going to reuse the Prototype application code yet again. So, open the
Finder and navigate to the location where you saved the
Prototype project. Right-click on the folder
containing the project files and select Duplicate; a folder called
Prototype copy will be created containing a
duplicate of the project. Rename the folder
Prototype4, and just as we did before, prune the
application down to the stub (as we did in the previous section for the
media player example) with the Go! button and associated
pushedGo: method that we’ll use to trigger the
display of our address book picker.
Click on the PrototypeViewController.h ...