我收到以下错误:
"Implicit conversion of Objective-C pointer type. Type "void*" requires a bridged cast.
我已经用网桥修复了类似的代码位 - 但这些类型的修复在这里没有帮助。这是代码位:
AURenderCallbackStruct input;
input.inputProc = RenderTone;
input.inputProcRefCon = self;
err = AudioUnitSetProperty(
toneUnit,
kAudioUnitProperty_SetRenderCallback,
kAudioUnitScope_Input,
0,
&input,
sizeof(input));
NSAssert1(err == noErr, @"Error setting callback: %ld", err);
有错误的第二个代码位
SStatus result = AudioSessionInitialize(NULL, NULL, ToneInterruptionListener, self);
if (result == kAudioSessionNoError) {
UInt32 sessionCategory = kAudioSessionCategory_MediaPlayback;
AudioSessionSetProperty(
kAudioSessionProperty_AudioCategory,
sizeof(sessionCategory),
&sessionCategory);
}
谢谢,提前提供所有帮助。
更新
问题解决了。桥梁铸造实施不正确。它应该是:
input. inputProcRefCon = (__bridge void*)self