views:

436

answers:

2

I am inserting every row to the UITable view using cellForRowAtIndexPath method. Now I need to always keep the last cell of the table view always selected. i.e. Whenever a new entry is added is should be in selected state and when it is deleted the previous entry of the table view must be in selected state. I tried using selectRowAtIndexPath:animated:scrollPosition: method but doesn't work out. Any ideas on how do I achieve this?

A: 

Use the selected property of UITableViewCell

freespace
+1  A: 

Try using selectRowAtIndexPath:animated:scrollPosition: from UITableView API in your methods that do the adding and subtracting after determining which item in your collection should be selected.

Greg