设置输出视频设置时出错

时间:2012-06-11 13:26:48

标签: ios xcode avcapturesession

output.videoSettings = [NSDictionary dictionaryWithObject:
    [NSNumber numberWithInt:kCVPixelFormatType_32BGRA]
    forKey:(id)kCVPixelBufferPixelFormatTypeKey];

我在这个特定的行上出现了这个错误

No known class method for selector "dictionaryWithObject:forKey:

出现此错误的原因是什么?

1 个答案:

答案 0 :(得分:3)

试试这个:

videoOutput.videoSettings = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithUnsignedInt:kCVPixelFormatType_32BGRA], (id)kCVPixelBufferPixelFormatTypeKey,
                             nil];