First of all, it's generally discouraged as a UI design to allow cells to stay selected. That is, inside your tableView:didSelectRowAtIndexPath: method, you should call [tableView deselectRowAtIndexPath:indexPath animated:YES] so that you get the nice animated highlight fade-away that people expect in an iPhone app. If, for some reason, you feel you need to keep the cell selected, it seems simple enough to keep around a reference to the last selected cell. Then, inside your tableView:didSelectRowAtIndexPath: method you could perform whatever changes you need to format the coloring of the formerly selected cell back to normal, and finally set your reference to the cell that has just been selected.

Luke


On May 11, 2009, at 2:16 PM, Eric E. Dolecki wrote:

I am using my own graphics for a tableview's cell background and selected
background (grouped tableview). I am using UILabels added to the
contentView, so I'm not setting the cell text directly at all. I have tagged the labels (3 in each cell) so I can get to them later within the selection
callback method.


I can easily get the current section and row. However I'd like to be able to get the previous selected cell to be able to reset it's UI. What do I mean? The selected cell background is dark so I need to switch the texts to white from black. But this means I need to reset the previous cells labels to
black again.


What's a good way to do this? Does that information come along for the ride on the callback method for cell selection? Do I need to reset the cells somehow and then change the text colors? It seems I have to implement some sort of state to have this happen, or else there is an approved established
way to so this already.


Thanks,

Eric
_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/luketheh%40apple.com

This email sent to [email protected]

_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to