SWIFT – Type does not match the protocol ‘avcapturefileoutputRecordingDelegate’

I’m trying to use AVCaptureMovieFileOutput.startRecordingToOutputFileURL to record audio to a file, and the function’s syntax requires the input of a variable of type “AVCaptureFileOutputRecordingDelegate”. All the help I have seen from this site indicates You need to make a class an extension of AVCaptureFileOutputRecordingDelegate and NSObject.

The problem is that I always get the error: The type’AVRecordDevices’ does not conform to the protocol’AVCaptureFileOutputRecordingDelegate’

How do I fix it?

P.S. I am developing for OS X, if that means anything in this case.

This means that you have not implemented the correct method in the view controller:

By carefully studying Apple’s documentation, you will find that there must be at least this:

func captureOutput(captureOutput: AVCaptureFileOutput!, didFinishRecordingToOutputFileAtURL outputFileURL: NSURL!, fromConnections connections: [AnyObject]!, error: NSError!)
{
}

https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVCaptureFileOutputRecordingDelegate_Protocol/

I am trying to use AVCaptureMovieFileOutput .startRecordingToOutputFileURL records audio to a file, and the function’s syntax requires input of a variable of type “AVCaptureFileOutputRecordingDelegate”. All the help I have seen from this site indicates that you need to make a class an extension of AVCaptureFileOutputRecordingDelegate and NSObject.

< /p>

The problem is that I always get the error: The type’AVRecordDevices’ does not conform to the protocol’AVCaptureFileOutputRecordingDelegate’

How can I solve it?

P.S. I am developing for OS X, if that means anything in this case.

This means You did not implement the correct method in the view controller:

By carefully studying Apple’s documentation, you will find that there must be at least this:

< pre>func captureOutput(captureOutput: AVCaptureFileOutput!, didFinishRecordingToOutputFileAtURL outputFileURL: NSURL!, fromConnections connections: [AnyObject]!, error: NSError!)
{
}

https:// developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVCaptureFileOutputRecordingDelegate_Protocol/

Leave a Comment

Your email address will not be published.