Chapter 3. Navigating

In This Chapter

  • Getting back to where you once belonged

  • Working with user preferences

  • Getting things done with selections

Once you have set up the basics for using table views, you need to allow the user to be able to select one of the entries and navigate to it. But as you will see, there's more involved in the selection process that may meet the eye.

In the first part of this chapter I'll show you how the selection mechanism works in table views.

Next, I'll show you how that mechanism can also be used to restore the state the application was in when the user last left the application.

Finally, I show you how user preferences may come into play during selection. I'll start by showing you how preferences work, and then I'll explain how you can use those preferences when the user does make a selection.

Working with User Selections

When the user taps on a table view entry, what happens next depends on what you want your table view to do for you.

If you're using the table view to display data (as the Albums view in the iPod application does, for example), you'd want a user's tap to show the next level in the hierarchy, such as a list of songs or a detail view of an item (such as information about a song).

In your case, you're going to want your user's taps to do more for you. When the user taps the Sights entry, he gets a list of sights from which he can choose to get more information. As such, you're essentially using the table view as a table of contents, so tapping a ...

Get iPhone® Application Development All-In-One For Dummies® 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.