Search code examples
iosipaduitableviewuisplitviewcontroller

how not to deselect a row in UITableView?


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).


Solution

  • 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.