내 앱에서 iPhone 플래시 표시 등을 사용해야합니다. 그러나 사용자가 플래시를 켤 때 카메라는 사진을 찍지 않습니다. 내가 어떻게 할 수 있니? 여기에 내 코드를 첨부했습니다. 그러나 플래시 라이트를 켜면 카메라가 사진을 찍습니다.iPhone 응용 프로그램에서 토치 라이트를 사용하는 방법?
AVCaptureDeviceInput *flashInput = [AVCaptureDeviceInput deviceInputWithDevice:device error: nil];
AVCaptureVideoDataOutput *output = [[AVCaptureVideoDataOutput alloc] init];
AVCaptureSession *session = [[AVCaptureSession alloc] init];
[session beginConfiguration];
[device lockForConfiguration:nil];
[device setTorchMode:AVCaptureTorchModeOn];
[device setFlashMode:AVCaptureFlashModeOn];
[session addInput:flashInput];
[session addOutput:output];
[device unlockForConfiguration];
[output release];
[session commitConfiguration];
[session startRunning];
[self setTorchSession:session];
어디에서 코딩이 잘못 되었습니까? 도와주세요. 미리 감사드립니다.
가능한 중복 : //stackoverflow.com/questions/3190034/turn-on-torch-flash-on-iphone-4) –