Search code examples
iosios7audiosession

AudioSessionRemovePropertyListenerWithUserData deprecated


In an app of mine I have the following code:

AudioSessionRemovePropertyListenerWithUserData(routeChangeID,cvcHandleRouteChange,(__bridge void *)(self));

I don’t see any problem with it, it has been working for a while and still works.

But I now get this warning:

…./MyViewController.m:1055:9: 'AudioSessionRemovePropertyListenerWithUserData' is deprecated: first deprecated in iOS 7.0

What am I supposed to do to make the compiler happy and get rid of the message? Even after browsing the net for a while I haven’t found any clear answer, for a way to replace this “deprecated code”.


Solution

  • Use AVAudioSession instead, to replace the deprecated AudioSession APIs.