我有5个UISwitch的simpel视图,我想确保只有4个可以同时关闭,我如何检查更多“如果” 我想这和它只是显示了alertview加班我使用的开关:同时检查更多UISwitch的状态
if (ishockeySwitch.state == NO | basketBallSwitch.state == NO | amrFootBallSwitch.state == NO | handBallSwitch.state == NO) {
UIAlertView *av = [[UIAlertView alloc] initWithTitle:@"Sofabold" message:@"Det er ikke en god ide, at fravælge alle sportsgrene." delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];
[av show];
[ soccerSwitch setOn:YES animated:YES];
}else {
// ........ do some stuff ...........
}
这里更新它编辑名之前必须复制....但同样的结果 – Skovie
为了澄清,你要显示的如果所有5个开关都设置为关闭,则提醒。正确?只要打开一个,你不需要警报,对吗? – rmaddy