Take the 2-minute tour ×

I have a UITableView in a UIViewController on ipad (ios 4.3.3)

I want the table cell to remain selected when i touch on it, and show the detail view controller for that cell on the other side of the UISplitViewController.

how can i achieve that? I did not call tableview:deselectRowAtIndexPath: anywhere, but the cell automatically gets deselected when I touch on it (with a flash of the blue color).

share|improve this question

2 Answers 2

up vote 1 down vote accepted

You can achieve it in below way.

I think you are reloading table.

So, when you press particular row, then store it's indexPath.row in local variable. like currIndexPathRow = indexPath.row And reload table.

Then check inside "CellForRowAtIndexPath". that if(indexPath.row == currIndexPathRow) then you can set some background image to that particular row.

Hope you have got the point.

Let me know in case of any difficulty.

share|improve this answer
You are right. Thanks very much! :) –  Chi Zhang Jun 15 '11 at 10:47

Are you using your own custom cells, or the default ones?

If you are using the default cells, in the nib, select the tableview, and in the attributes inspector, under the tableview section, check the box beside the "Show Selection on Touch" option. This will automatically put a Blue highlight over the cell.

You can customize this too if you make custom cells. For a custom cell, in the nib, select the tableviewcell, and in the attributes inspector, in the "Selection" option, you can select "Blue, Grey, or None".

If you select None, no selection will be displayed, even if the tableview has a check on the box beside the "Show Selection on Touch" option.

share|improve this answer

Your Answer


