UISwitch *whichSwitch = (UISwitch *) sender; BOOL setting = whichSwitch.isOn; [leftswitch setOn:setting animated:YES]; [rightswitch SetOn:setting animating:YES]; The last two lines especially leave me clueless.