MOBILE

iPhone Application Development : Understanding Table Views and Navigation Controllers

4/27/2011 6:02:19 PM

Tables

Like the other views you’ve seen in this book, a table view (UITable) holds information. A table view’s appearance, however, is slightly counterintuitive. Instead of showing up as a true table (like an Excel worksheet), a table view displays a single list of cells onscreen. Each cell can be structured to contain multiple pieces of information but is still a single unit. In addition, the cells can be broken into sections so that the clusters of information can be communicated visually. You might, for example, list computer models by manufacturers or models of the Macintosh by year. Table views respond to touch events and allow the user to easily scroll up and down through long lists of information and select individual cells through the help of a table view controller (UITableViewController).

Types of Tables

There are two basic styles of table views: plain and grouped, demonstrated in Figures 1 and 2, respectively. Plain tables lack the clear visual separation of sections of the grouped tables but are frequently implemented with a touchable index (like the iPhone contact list). Because of this, they are sometimes called indexed tables. We will continue to refer to them by the names (plain/grouped) designated in Interface Builder.

Figure 1. Plain tables look like simple lists.


Figure 2. Grouped tables have emphasized sections.


Navigation Controllers

Tables are a great tool for displaying information in lists and enabling a user to choose from the list. However, tables are rarely used on their own in an iPhone application. More frequently, they are used in conjunction with a navigation controller (UINavigationController). Navigation controllers provide a simple means for users to drill down through multiple views of data, as well as to return to where they started.

You might recognize navigation controllers from many other applications on the iPhone, such as the Contacts application, where a group of individuals can be chosen, then a specific person, and finally, individual contact details. At any time, the user can click a button at the top of the view (the UINavigationBar) to return to the previous level of detail, as demonstrated in Figure 3.

Figure 3. Navigation controllers enable simple drill-down interfaces within an application.
Other  
  •  Windows Phone 7 Development : Revising WeatherRx to Manage Slow Data Connections
  •  Windows Phone 7 Development : Handling Data Connection Issues with Rx.NET
  •  Windows Phone 7 Development : Handling Errors in Rx.NET
  •  Windows Phone 7 Development : Using Rx.NET with Web Services to Asynchronously Retrieve Weather Data
  •  Windows Phone 7 Development : Media - Adding Sounds to an Application
  •  iPhone Application Development : Building a Multi-View Tab Bar Application (part 4) - Implementing the Summary View
  •  iPhone Application Development : Building a Multi-View Tab Bar Application (part 3) - Implementing the Volume View
  •  iPhone Application Development : Building a Multi-View Tab Bar Application (part 2) - Implementing the Area View
  •  iPhone Application Development : Building a Multi-View Tab Bar Application (part 1)
  •  Windows Phone 7 Development : Working with Video (part 2) - Coding the Application
  •  Windows Phone 7 Development : Working with Video (part 1)
  •  Windows Phone 7 Development : Plotting an Address on a Bing Maps Map and Working with the Bing Maps Service
  •  Windows Phone 7 Development : Using GeoCoordinateWatcher and the Bing Maps Control to Track Your Movements
  •  iPhone Application Development : Creating a Multi-View Toolbar Application (part 3) - Adding Toolbar Controls
  •  iPhone Application Development : Creating a Multi-View Toolbar Application (part 2) - Instantiating the View Controllers
  •  iPhone Application Development : Creating a Multi-View Toolbar Application (part 1)
  •  Windows Phone 7 Development : Using Location Services - Simulating the Location Service
  •  Introducing the Windows Phone Location Service and Mapping APIs
  •  iPhone Application Development : Implementing a Custom Picker View (part 4) - Tweaking the Picker UI
  •  iPhone Application Development : Implementing a Custom Picker View (part 3) - Reacting to a Picker View Choice
  •  
    Top 10
    Exchanging XML Messages over HTTP
    Programming the Mobile Web : Widgets and Offline Webapps - Standards
    iPhone 3D Programming : Anti-Aliasing Tricks with Offscreen FBOs (part 1) - A Super Simple Sample App for Supersampling
    Windows Server 2008 : Planning Operating System Virtualization (part 1)
    Algorithms for Compiler Design: Implementation
    Worker Processes, Application Pools, and Identities in IIS 7
    Cloud Computing for the Corporation
    Exchange Server 2010 : Perform Essential Database Management (part 3) - Manage Database Settings
    Personalizing Windows 7 (part 6) - Configuring Your Monitors
    Leveraging and Optimizing Search in SharePoint 2010 : Keywords and Best Bets
    Most View
    Using MySQL Enterprise (part 3) - Query Analyzer
    Active Directory Domain Services 2008 : View Cached Credentials on a Read-Only Domain Controller
    IIS 7.0 : Application Logging
    Communicate Between Two Machines on the Same Network (WCF)
    Programming .NET Security : Symmetric Encryption Explained (part 3)
    Deploying a Public Key Infrastructure with Windows Server 2008 R2
    Windows Phone 7 Development : Handling Data Connection Issues with Rx.NET
    Download Web Content via HTTP
    Architecting Applications for the Enterprise : UML Diagrams (part 3) - Sequence Diagrams
    Windows 7 : Configuring Remote Management
    Windows Phone 7 Development : Revising WeatherRx to Manage Slow Data Connections
    Windows 7 : Rolling Back to a Stable State with System Restore
    Java Mobile Edition Security : Configurations, Profiles, and JSRs
    Windows Server 2008 : DHCP/WINS/Domain Controllers - Reviewing the Windows Internet Naming Service (WINS)
    How Exceptions Work in SQL Server
    Building a WPF Application without XAML (part 1)
    Using the Dynamic Keyword in C# 4.0
    Supporting Computers Running Windows Vista
    Programming Microsoft SQL Server 2005 : Querying XML Data Using XQuery (part 2) - SQL Server 2005 XQuery in Action
    SQL Server 2008: Managing Resources with the Resource Governor (part 2) - Workload Groups