我想做验证in Multiple dynamic
单选按钮. I want to check
单选按钮是否is
被选中。如果未选中,则显示警报并选中,然后转到另一件事。
以下代码我使用..
-(IBAction)btnNextClicked:(id)sender{
if ([appDelegate.questions count]> i) {
for (UIButton *btn in self.view.subviews)
{
if ([btn isKindOfClass:[UIButton class]])
{
if (btn.selected)
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"BizVibe" message:@"Please select answer" delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
[alert show];
[alert release];
return;
}
else{
for (int k=0; k<[[[appDelegate.questions objectAtIndex:i-1] objectForKey:[[appDelegate.questions objectAtIndex:i-1] objectForKey:@"question"]] count]; k++) {
for (UILabel *lbl in self.view.subviews)
{
if ([lbl isKindOfClass:[UILabel class]])
{
if (lbl.tag==k)
{
[lbl removeFromSuperview];
}
}
}
for (UIButton *btn in self.view.subviews)
{
if ([btn isKindOfClass:[UIButton class]])
{
if (btn.tag==k)
{
[btn removeFromSuperview];
}
}
}
}
[self LoadQuestionAnswer];
return;
}
}
}
}
else{
Term_para *termMSP = [[Term_para alloc]init];
[self.navigationController pushViewController:termMSP animated:YES];
[termMSP release];
}
}
请帮帮我我能做什么?
提前致谢..