Do you have references for both switches ? If yes, it will be something like this :
-(void)stateSwitchedtwoplayer:(id)sender {
UISwitch *tswitch = (UISwitch *)sender;
self.switchGroup.on =! tswitch.isOn; //reference to group switch
NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
[defaults setBool: tswitch.isOn forKey:@"twoplayerswitch"];
[defaults setBool: !tswitch.isOn forKey:@"groupswitch"];
[defaults synchronize];
}
-(void)stateSwitchedgroup:(id)sender {
UISwitch *tswitch = (UISwitch *)sender;
self.switchTwoPlayer.on =! tswitch.isOn; //reference to two players switch
NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
[defaults setBool: tswitch.isOn forKey:@"groupswitch"];
[defaults setBool: tswitch.isOn forKey:@"twoplayerswitch"];
[defaults synchronize];
}
but if you want that both switches can be off, then you just need to change it on
self.switchGroup.on =! tswitch.isOn == YES; //reference to group switch
self.switchTwoPlayer.on =! tswitch.isOn == YES; //reference to two players switch