views:

209

answers:

1

How can you find out if a AVAudioPlayer finished playing a sound inside of a function?

A: 

I'm assuming you really mean "via a function" because you should be able to use the obj-c bracket syntax [myAudioPlayer isPlaying] from inside your function.

If my assumption is correct, it may be worthwhile to read this and this. Then the following will make sense:

objc_msgSend(myAudioPlayer,@selector(isPlaying:));

slf
How can you put that in a "if"-statement?
Emil
Nevermind, found it myself :)Thank you!
Emil
You should NEVER call `objc_msgSend` directly.
Jacob Relkin