How can I turn a switch off inside a different switch? Here's an example - When the isMale switch is turned on, turn off the isFemale switch.
- (IBAction)isMale:(id)sender {
if ([sender isOn]) {
//TURN isFemale SWITCH OFF
}
else {
...
}
}
and
- (IBAction)isFemale:(id)sender {
if ([sender isOn]) {
//TURN isMale SWITCH OFF
}
else {
...
}
}
I've been reading the Apple development docs but cannot find anything about changing a switch inside another switch. Cheers.
first of all you need to create
IBOutletof bothUISwitchin your header.hfilethen in your
IBActiondo as follow.remember to connect both of your
IBOutletto respective objects in yourUIViewController.