Scene:
sub-class cell has a button, with the selected style, click the button in the first cell, the button in cell one gets the selected style, but when clicked on the button in cell two, The button selection in cell one still exists, i.e. there are two selected buttons at the same time.
Workaround:
In a sub-class cell, define a
Static UIButton *selectedbutton;
Must be a static variable.
Then in the click Method,
-(void) Headerbuttonclickaction: (UIButton *) btn { selectedButton.layer.borderWidth = 0; Btn.layer.borderWidth = 2; Selectedbutton = btn; }
So I can take the button that I clicked last time,
I set the border width display is selected, I can write the demo according to their own needs.
There is no need to worry about the program when the first execution of Selectedbutton is nil and nil.
IOS: Set button in another cell in one cell