Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ulquiorra

macrumors member
Original poster
Jun 17, 2009
38
0
Hello all ,

I seem to be having a problem in my UITableView clicking behaviour. I'm using a Tree to create a hiearchy of tableviews.

My problem arises when I enter the following screen ( I produced some screenshots to clarify ).

1) When I enter this screen

http://img129.imageshack.us/img129/4050/samplec.png

I can go to my next tableview by clicking on my info button below( second from the left)( so not by clicking on the cell). This works. It will go to the tableview associated with the previous row.

Here is where my "problem" starts. As soon as I click outside my current tableview , for instance on the empty cell below or if I click the same cell and drag it a bit, then my cell will become unselected.

2) As you can see in the image below.

http://img245.imageshack.us/img245/5930/sample3i.png

I do not want this to happen. I want my cell despite the fact that I'm clicking around to stay selected. Is there a way to realize this?
 
The cell stays selected until your code unselects it. This happens explicitly by deselectRowAtIndexPath and implicitly by reloadData. Maybe also by beginUpdates/endUpdates. A memory warning will also result in it being deselected probably. The selection remains even if you push another view controller and then touch the back button.
 
thnx for your reply... but I've managed to solve it.
I created an extra variable in which i saved my previously selected cell and then call that one when I hit the button..
But I appreciate the explanation and your answer.
 
I believe the Mobile HIG states you shouldn't leave table cells permanently selected (they are only used to indicate with momentary visual feedback that a selection has been triggered) and that you should use some other mechanism, such as a check-mark, to indicate permanent selection.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.