使用以下代码时出现了以下错误:
“无法将类型为'inout NSError?'(又名'inout Optional')的值转换为所期望的参数类型'()'”
这个错误出现在以下代码行上:
以下是剩余的代码:
“无法将类型为'inout NSError?'(又名'inout Optional')的值转换为所期望的参数类型'()'”
这个错误出现在以下代码行上:
if device.lockForConfiguration(&error)
以下是剩余的代码:
func focusWithMode(focusMode:AVCaptureFocusMode, exposureMode:AVCaptureExposureMode, point:CGPoint, monitorSubjectAreaChange:Bool){
dispatch_async(self.sessionQueue!, {
var device: AVCaptureDevice! = self.videoDeviceInput!.device
var error: NSError? = nil
if device.lockForConfiguration(&error){
if device.focusPointOfInterestSupported && device.isFocusModeSupported(focusMode){
device.focusMode = focusMode
device.focusPointOfInterest = point
}
if device.exposurePointOfInterestSupported && device.isExposureModeSupported(exposureMode){
device.exposurePointOfInterest = point
device.exposureMode = exposureMode
}
device.subjectAreaChangeMonitoringEnabled = monitorSubjectAreaChange
device.unlockForConfiguration()
}
})
}