In IB I create 9 buttons (custom) and a select for State config: selected (button1.png) disabled (button1_disabled.png)…..(button9_disabled.png)
this tip if only when select button and unselected button
- (IBAction)onButtonsTapped:(UIButton*)sender {
[[sender setSelected:![sender isSelected]];
[priviousSelectedBtn setSelected:NO];
}
but i want to release that:
When I press button 1 (action) change the picture on the button 1 (setSelected: YES)
I press the button 2 (action) change the picture on the button 2 (setSelected: YES) and change the image on the number 1 (setSelected: NO)
I press the button 9 (action) change the image on the button 9 (setSelected: YES) and change the image on the button 2 (setSelected: NO)
You can create nine outlets for each button and loop through them to check and unselect.
(Codes not compiler checked, you may get some idea)
Or, you can store an outlet for previousSelectedButton.