You either need to connect the UISwitch to an IBAction method that updates isOn, or read the state of the switch in your test.
Here's the latter: UPDATE Changed the code after you clarified the relationships between the view controllers.
- (void)updateLabels:(NSString *)text isOn:(BOOL)isOn {
[nameLabel setText:text];
if (isOn == YES) {
[onLabel setText:(@"ON")];
} else {
[onLabel setText:(@"OFF")];
}
}
The call to updateLabels, which I'm hoping exists in FlipSideViewController, should look something like this: (I obviously don't know your variables names.)
[self.delegate updateLabels:self.myTextField.text isOn:self.mySwitch.on];
Robot K
2010-09-30 20:15:32