First, the idea
First set a Choosecelltag tag (type Nsindexpath), and then when clicking on the cell trigger, if the tag setting has a value, set the
UITableViewCell *selectedcell = [TableView cellforrowatindexpath:tag];
SelectedCell. accessorytype = uitableviewcellaccessorynone;
Then put tag = Indexpath
And then
Cell. accessorytype = Uitableviewcellaccessorycheckmark;
Second, the main code:
1. In the interface of. m
@interface choosetypeviewcontroller ()
{
nsindexpath *tag;
}
@end
2. Click on the event triggered by the cell.
-(void) TableView: (uitableview *) TableView Didselectrowatindexpath: (nsindexpath *) Indexpath
{
[TableView deselectrowatindexpath: Indexpath animated:TRUE];
UITableViewCell *cell = [TableView cellforrowatindexpath: Indexpath];
if (tag) {
UITableViewCell *selectedcell = [TableView cellforrowatindexpath:tag];
SelectedCell. accessorytype = uitableviewcellaccessorynone;
}
tag = Indexpath;
Cell. accessorytype = Uitableviewcellaccessorycheckmark;
}
Implementation of ios-Radio cell