views:

258

answers:

1

hi, i have 2 UIImage and a UISwitch, when the switch is on, image 1 appear and when the switch is off the image 2 appear... any ideas? thanks

A: 

If you have a UISwitch called myUISwitch and a UIImageView called myUIImageView:

if(myUISwitch.on) {
[myUIImageView setImage:[UIImage imageNamed:@"myOnImage.png"]];
}
else {
[myUIImageView setImage:[UIImage imageNamed:@"myOffImage.png"]];
}

You can put this code in the function triggered by changing the UISwitch...

Eric Schweichler