views:

19

answers:

1

Hi, I have two UISwitch....and i need to turn off the first one when the second one is turn on and also turn on the first one when the second one is off....

similarly when first is on second will go off and vice varca...

any idea??

+1  A: 

Add an IBAction for both switches

- (IBAction)toggleForFirstSwitch
{
    [secondSwitch setOn:!firstSwitch.on animated:YES];
}

- (IBAction)toggleForSecondSwitch
{
    [firstSwitch setOn:!secondSwitch.on animated:YES];
}

or something like that anyway :)

willcodejavaforfood
good....but what happen when first one is turn on...then the second one will toggle....and this cause the first one toggle again and i think a dead lock...is not it??
Rony
I think the action is only activated when there is a touch up inside the toggle. Obviously you would have to configure it like that :)
willcodejavaforfood
good idea...but i am using....customize switch....."homick-iPhone-Snippets-2c581e4"....so how it possible in this case??
Rony
Did you manage to get it to work?
willcodejavaforfood