Adding the little arrow to the right side of a cell in an iPhone TableView Cell

This should be simple enough.

I have an iPhone app with a TableView. How do I add the little classic arrow to the righthand side of each cell?


Just set the respective accessoryType property of UITableViewCell.

cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;

In Swift 3,

cell.accessoryType = .disclosureIndicator

You can do this in Interface Builder. Simply click click on the Table View, go to Prototype Cells on the right side and make it 1. Then click that Prototype Cell and on the right look for Accessory. In the drop-down, click Disclosure Indicator.

Interface Builder example