Действие, когда звук закончил играть в AVAudioPlayer?

Бессмысленная версия Haskell (15 символов, хотя действительно не работает, если Вы не включаете Управление. Стрелка и Управление. Монада и игнорирует ограничение мономорфизма):

p=ap(==)reverse
18
задан Evelyn 13 July 2009 в 16:59
поделиться

1 ответ

When a sound is finished playing, I want the application to do something.

Then set yourself as the delegate and respond to audioPlayerDidFinishPlaying:successfully:.

In the code snippet you showed, you've done step 2 but not step 1: You're not setting yourself as the delegate.

I tried to use applicationDidFinishLaunching to do the action at the end of the first sound …

Brain fart? That method has nothing that I can see to do with playing sounds.

…, but I couldn't use that for the second sound because I got a redefinition error.

Huh? Did you implement the method twice or something instead of just comparing the player object in the method body?

It would help if you showed the exact error message you got.

24
ответ дан 30 November 2019 в 08:27
поделиться
Другие вопросы по тегам:

Похожие вопросы: