title: How to save UISwitch state on plist file?
body: <p>i am trying to save the state of UISwitch .If the UISwitch state is <strong>"ON"</strong> and when the user quits the app and starts it again ..the app should show the previous state and  if the user plans to change the state of UISwitch to <strong>"OFF"</strong>..he should get a message saying previously he had <strong>"ON"</strong> state and change to state to <strong>"OFF"</strong></p>
  
  <p>if you guys help me out that would be great .Thanks</p>
  
  <pre><code>-(IBAction)notification:(id)sender
  {
      if (sender == notifyMe)
      {
          if(notifyMe.isOn == YES)
          {
              toggle = YES;
              NSUserDefaults* defaults  = [NSUserDefaults standardUserDefaults];
              [defaults setBool:notifyMe.on forKey:@"switchValueKey"];
              [defaults synchronize];
              NSLog(@"Notification is ON");
          }
          else 
          {
              toggle = NO;
              NSLog(@"Notification is OFF");
          }
      }
      if ([cellDelegate respondsToSelector:@selector(notificationReqd:)])
      {
          [cellDelegate notificationReqd:self];
      }
  }
  </code></pre>