Chapter 4. Accessing the address book/contacts in Dial4

 

This chapter covers

  • Master-detail applications
  • Table views
  • Working with the address book

In this chapter, you’ll create an app called Dial4, which will tap into the iPhone’s address book. Although apps aren’t allowed access into all areas of the device (such as a user’s phone number), there are areas in the address book that you can access and even modify. This allows an app to display contact data and even update it based upon a user’s actions. This can be useful for a variety of apps, including those that select a location based upon a contact address or those that dial a contact’s phone number.

As you’ll soon see in this chapter, the iOS SDK provides developers with a direct UI into the address book to display entries and allow users to select those entries. Although this is handy, there are some limitations in how the data is displayed. For this reason, when creating your Dial4 app, you’ll allow the user to access the contacts directly, allowing them to navigate into the list. To do this, you’ll display the applicable contact data in a table view for the user. In this way, you avoid displaying nonapplicable data like their mailing address. Another advantage of displaying your Dial4 data in a table view is that it gives you an easy route for filtering the data as the user types into the app.

4.1. Creating a master-detail application with a table view

4.2. Presenting data using a table view

4.3. Accessing the address book

4.4. Managing table data

4.5. Summary

sitemap