Making an Address Book

Let’s take a look at an example that starts to combine a lot of what you have learned to this point by creating an address book.2 Your address book will contain address cards. For the sake of simplicity, your address cards will contain only a person’s name and email address. Extending this concept to other information, such as address and phone number, is straightforward, but we leave that as an exercise for you at the end of this chapter.

2 OS X and iOS provide an entire Address Book framework that offers extremely powerful capabilities for working with address books.

The two classes we create, an AddressBook and an AddressCard class, and the relationship between the two are depicted in Figure 15.5.

Figure 15.5. An ...

Get Programming in Objective-C, Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.