简体   繁体   中英

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
);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM