When a cell in a UITableView leads to a subview, it can be useful to have some added visual context. A disclosure indicator in a UITableViewCell is a small chevron displayed at the right edge to visually indicate that it leads somewhere.

For example, take a look at the “History” folder in the Mobile Safari Bookmarks:


iOS Safari Bookmarks

Nifty, right? Here’s how to do it:

– (UITableViewCell *)tableView:(UITableView *)tableView
    cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView
        dequeueReusableCellWithIdentifier:CellIdentifier];

    if (cell == nil)
    {
        cell = [[[UITableViewCell alloc]
            initWithStyle:UITableViewCellStyleDefault
            reuseIdentifier:CellIdentifier] autorelease];
    }

    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;

    return cell;
}


Keep in mind that a disclosure indicator is merely for visual context; it doesn’t actually do anything. You still have to implement the subview you want to display.