i have 3 switches on my view controller. If the user changes any of these then the 3 settings need to be persisted to a db.
so
switch a = 1, switch b = 0 and switch c = 1
persist to db
switch a = 0, switch b = 1 and switch c = 1
perssit to db
switch a = 0, switch b = 0 and switch c = 0
persist to db etc
I can trigger one fine with a event but when i try and compare the other ones when the event triggers on one switch i get loads of errors.
I am using an If command and switch.on.
So how can i trap an event when three switches are being amended.
thanks
UPDATE :::
I have done this code : and when i press the button i get the error
[self.Switch1 addTarget:self action:@selector(flipswitch:) forControlEvents:UIControlEventValueChanged];
[self.NSwitch2 addTarget:self action:@selector(flipswitch:)forControlEvents:UIControlEventValueChanged];
[self.Switch3 addTarget:self action:@selector(flipswitch:)forControlEvents:UIControlEventValueChanged];
}
- (IBAction) flipSwitch: (UISwitch *) sender
{
}
and when i change a switch i get
2014-03-05 18:11:44.775 OutTonight[4788:60b] -[SettingsViewController flipswitch:]: unrecognized selector sent to instance 0x15ec9fd0
2014-03-05 18:11:44.777 OutTonight[4788:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[SettingsViewController flipswitch:]: unrecognized selector sent to instance 0x15ec9fd0'
All I am trying to do is compare 3 switches and then just persist to the database.