Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat does this error even mean?
    primarykey
    data
    text
    <p>I got this error, and as I program xcode only at my house, I have no resources to quickly ask even the most simple 10 second questions. So this is one that came up today, I am using the AudioSessionAddPropertyListener function, and I get this warning:</p> <p>passing 'CFTypeRef' (aka 'const void <em>) to parameter of type 'void</em>' discards Qualifiers</p> <p>from this line of code.</p> <pre><code>// Registers the audio route change listener callback function // An instance of the audio player/manager is passed to the listener AudioSessionAddPropertyListener ( kAudioSessionProperty_AudioRouteChange, audioRouteChangeListenerCallback, CFBridgingRetain(self) ); </code></pre> <p>then definition of the AudioSessionAddPropertyListener is </p> <pre><code>AudioSessionAddPropertyListener( AudioSessionPropertyID inID, AudioSessionPropertyListener inProc, void *inClientData) </code></pre> <p>and I see the *inClientData variable appears to be of type void (Or maybe not)</p> <p>So what exactly might be the problem here, Mostly I would like to know what to look for when trouble shooting. I don't know what I don't know.</p> <p>thanks</p> <p>Steve </p> <p>I'm not at 50 yet so I can't comment:</p> <p>I looked at the definition of CFBridgingRetain it takes ID, and returns CFTypeRef</p> <pre><code>NS_INLINE CF_RETURNS_RETAINED CFTypeRef CFBridgingRetain(id X) { return (__bridge_retained CFTypeRef)X; } </code></pre> <p>Now the definition of CFTypeRef is void /* Base "type" of all "CF objects", and polymorphic functions on them */ typedef const void * CFTypeRef;</p> <p>so in order to drop the warning I did this, cast the output of the function as (void *)</p> <pre><code>AudioSessionAddPropertyListener ( kAudioSessionProperty_AudioRouteChange, audioRouteChangeListenerCallback, (void *) CFBridgingRetain(self) ); </code></pre> <p>Does anyone see an issue with this?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload