Is there any way of changing the UITableViewCellAccessory in the didSelectRowAtIndexPath function?
I need to change a "play"-icon to a "stop"-icon..
Thanks :)
Is there any way of changing the UITableViewCellAccessory in the didSelectRowAtIndexPath function?
I need to change a "play"-icon to a "stop"-icon..
Thanks :)
You can get a pointer to the table cell in question by using the method
cellForRowAtIndexPath:
and passing the indexPath that is passed in as a parameter to didSelectRowAtIndexPath: and then change it's accessoryView property. Like this:
UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];
[cell setAccessoryView:stopIconView];
Where stopIconView is likely to be a UIImageView or something.
Might be worth looking at the accessoryView property in UITableViewCell and see if it is possible to add an image to it.