Jason
Jason

Reputation: 14615

How to display UITableViewCellAccessoryCheckmark when setEditing is ON?

I'm trying to use a UITableView with some cells having the 'delete' option which is available when setEditing is set to YES, and the other cells in the table not having this option. This works great. However, there is another section of my table that I want to be able to have UITableViewCellAccessoryCheckmark--but being in the edit mode seems to hide this. Is there a way to display this accessory when in the edit mode?

Upvotes: 2

Views: 1561

Answers (1)

elusive
elusive

Reputation: 470

Since hidesAccessoryWhenEditing was deprecated in 3.0, use the UITableViewCell's editingAccessoryType property like so:

[cell setEditingAccessoryType:UITableViewCellAccessoryCheckmark]; or cell.editingAccessoryType = UITableViewCellAccessoryCheckmark;

or the appropriate accessory type to suit your needs.

Source: Deprecated UITableViewCell Methods

Upvotes: 5

Related Questions