我有一个奇怪的问题radio button
。我使用UIButton
并radio button
使用了两个图像btnCheck.png
,btnUnCheck.png
在正常情况下它工作正常没有问题。这是我点击按钮的代码
-(IBAction)btnNextClick:(id)sender {
UIImage* selectedImg=[UIImage imageNamed:@"btnCheck.png"];
if ((btnILink.imageView.image == selectedImg || btnTapeIn.imageView.image == selectedImg || btnKeraLink.imageView.image == selectedImg))
{
if (btnTapeIn.imageView.image == selectedImg) {
UIImage* selectedImg1=[UIImage imageNamed:@"btnCheck.png"];
if (!(btn18.imageView.image == selectedImg1 || btn22.imageView.image == selectedImg1)){
[FunctionManager showMessage:@"" withMessage:@"Please Select Length" withDelegage:nil];
return;
}
}
else {
UIImage* selectedImg1=[UIImage imageNamed:@"btnCheck.png"];
if (!(btn16.imageView.image == selectedImg1 || btn18.imageView.image == selectedImg1 || btn22.imageView.image == selectedImg1)){
[FunctionManager showMessage:@"" withMessage:@"Please Select Length" withDelegage:nil];
return;
}
}
}
else {
[FunctionManager showMessage:@"" withMessage:@"Please Select Method" withDelegage:nil];
return;
}
}
当我点击它时它工作正常btnNext
,如果没有选择任何一项,那么它会显示消息。但问题是当我选择这两个项目并进入后台时,我会在应用程序中返回并单击下一步,然后它会显示消息,但复选框已被选中。为什么在那种情况下条件不正确......