title: How do I change the value of BOOL?
body: <p>How do I change the value of a BOOL in Objective-C? <code>lightOn</code> is the <code>BOOL</code> value I need help modifying.</p>
  
  <pre><code>@synthesize button, view;
  -(IBAction)torchOn:(id)sender;
       {
            AVCaptureDevice*flashlight = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
  if([flashlight isTorchAvailable] &amp;&amp; [flashlight isTorchModeSupported:AVCaptureTorchModeOn] &amp;&amp; [lightOn = YES])
  {
      BOOL success  [[flashlight lockForConfiguration:nil]];
      if(success)
      {
          [flashlight setTorchMode:AVCaptureTorchModeOn];
          [flashlight unlockForConfiguration];
          lightOn = NO;
      }
  }
  </code></pre>
  
  <p>}</p>