在我的应用程序中,我有 3 个按钮,我想在选择任何 1 个按钮时禁用剩下的 2 个按钮,我尝试使用以下逻辑,这里我用来执行它的代码无法正常工作,
-(void)checkboxSelected13:(id)sender
{
UIButton *btn = (UIButton *) sender;
if([btn isSelected])
{
[bt27 setSelected:YES];
[bt28 setSelected:NO];
[bt29 setSelected:NO];
}
else if ([btn isSelected]) {
[bt27 setSelected:NO];
[bt28 setSelected:YES];
[bt29 setSelected:NO];
}
else
{
[bt27 setSelected:NO];
[bt28 setSelected:NO];
[bt29 setSelected:YES];
}
}
我的代码有什么问题?请帮忙