我收到以下错误:
"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