音频流 iOS 类 - ARC 错误



我正在尝试实现Matt Gallagher的AudioStreamer类,Audiostream.m文件上收到20+错误,基本上是读取:

Cast of C pointer type 'void *' to Objective-C pointer type 'AudioStreamer *' requires a bridged cast

我是iOS新手。我知道 ARC 是什么,但这个错误是什么意思?

因为错误表明您需要桥接转换。请阅读该问题,了解可用桥接铸件之间的差异。如果您有时间观看WWDC 2011会议323。


您可能只需要这样的东西:

AudioSessionInitialize (
    NULL,                          // 'NULL' to use the default (main) run loop
    NULL,                          // 'NULL' to use the default run loop mode
    MyAudioSessionInterruptionListener,  // a reference to your interruption callback
    (__bridge void *)(self)                       // data to pass to your interruption listener callback
);

最新更新