IOS UIButton selected status switch

UIButton*payBtn = [UIButtonbuttonWithType:UIButtonTypeCustom]; payBtn.frame=CGRectMake (size.width-24-15,13,24,24); payBtn.tag= J +1; [payBtnsetImage:IMG (@ selectNo) forState:UIControlStateNormal]; [payBtnsetImage:IMG (@ selectNo) forState:UIControlStateHighlighted]; [payBtnsetImage:IMG (@ selectYes) forState:UIControlStateSelected]; [payBtnsetImage:IMG (@ selectYes) forState:UIControlStateSelected|UIControlStateHighlighted] [payBtnaddTarget:selfaction:@ selector (selectPayStyle:); forControlEvents:UIControlEventTouchUpInside]; [payStyleLabeladdSubview:payBtn]; - (void) (selectPayStyle: UIButton* if (btn{) BTN! =self.selectedBtn) {self.selectedBtn.selected=NO; btn.selected=YES; self.selectedBtn= BTN;}else{self.selectedBtn.selected=YES;}}
IOS UIButton selected status switch