Iphone - UISwitch Turned Off On Exit
===

I want to set a switch to off when the app enters into background.  I am trying to do it using the following code.  It isn't working :(  When I resume app the switch is still "on" on animation on the screen.  How can I fix this?

    - (void)applicationWillResignActive:(UIApplication *)application {
        [registrationSwitch setOn:NO animated:YES];
    }