I would like to make a UITableViewCell with one label and two accessory types:
- Unselected cells should display a
UITableViewCellAccessoryDetailDisclosureButtonaccessory. - The selected cell should display both the
UITableViewCellAccessoryDisclosureIndicatorand theUITableViewCellAccessoryDetailDisclosureButtonaccessories.
The only way I know how to do this is by using an image for the selected cell’s accessory view. Is there an alternative way to do this?
In your
Then in
So the trick is just to keep a reference to the selected cell and set the indicator accordingly.
Note that you might want to test if the cell is already selected before setting the selectedIndex, in that case you should set selectedIndex = nil.