Neo
Neo

Reputation: 897

Keeping the last row selected of UITableView

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?

Upvotes: 0

Views: 1177

Answers (2)

Greg
Greg

Reputation: 1146

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.

Upvotes: 2

freespace
freespace

Reputation: 16701

Use the selected property of UITableViewCell

Upvotes: 0

Related Questions