当前位置: 动力学知识库 > 问答 > 编程问答 >

iphone - Audiostreamer iOS class - ARC error

问题描述:

I'm trying to implement Matt Gallagher's AudioStreamer class and I'm getting 20+ errors on Audiostream.m file that are basically reading:

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

I'm new to iOS. I know what ARC is, but what does this error mean?

网友答案:

as the error suggests you need a bridged cast. Please read that question for the differences between the available bridged casts. And if you have time watch WWDC 2011 session 323.


You probably just need something like this:

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
);
分享给朋友:
您可能感兴趣的文章:
随机阅读: