1

我不断从我开发的应用程序中收到以下错误消息:

[AVCaptureVideoDataOutput startRecordingToOutputFileURL:recordingDelegate:]: unrecognized selector sent to instance 0x190e10

用于此的代码来自以下按钮以录制视频:

- (IBAction)takeVideo {
    AVCaptureMovieFileOutput *movieFileOutput = [[AVCaptureMovieFileOutput alloc] init];

    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectoryPath = [paths objectAtIndex:0];
    NSString *movieFileName = [NSString stringWithFormat: @"something.mov"];
    NSString *mypath = [documentsDirectoryPath stringByAppendingPathComponent:movieFileName];
    NSURL *outputURL = [[NSURL alloc] initFileURLWithPath:mypath];

    [self.captureSession addOutput:movieFileOutput];
    [movieFileOutput startRecordingToOutputFileURL:outputURL recordingDelegate:self];
    [outputURL release];
}

我做错了什么?

请帮忙

4

1 回答 1

1

您的类可能没有实现AVCaptureFileOutputRecordingDelegate协议的所有必需方法:具体来说,您需要实现captureOutput:didFinishRecordingToOutputFileAtURL:fromConnections:error:

请参阅文档

于 2013-06-24T14:27:21.663 回答