Objective-CでBOOLの値を変更するにはどうすればよいですか?変更の手助けが必要な値ですlightOn
。BOOL
@synthesize button, view;
-(IBAction)torchOn:(id)sender;
{
AVCaptureDevice*flashlight = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
if([flashlight isTorchAvailable] && [flashlight isTorchModeSupported:AVCaptureTorchModeOn] && [lightOn = YES])
{
BOOL success [[flashlight lockForConfiguration:nil]];
if(success)
{
[flashlight setTorchMode:AVCaptureTorchModeOn];
[flashlight unlockForConfiguration];
lightOn = NO;
}
}
}