iphone - audioPlayerDidFinishPlaying not being called during scrolling UITableView -


One of my thoughts is UITableView which acts as a representative of AVAudioPlayer and this table essentially runs sound when you select a certain line with options, then you can repeat the sound after its expiry.

However, I have noticed that if I select a cell again for a certain sound and then scroll through UITableView to select a different sound , Then it repeats exactly as soon as I stop scrolling until the scrolling stops, so it will be audioplayerDidfinist playing (and therefore do not repeat it). Or if I do not scroll at all, it just repeats exactly.

What could happen during scrolling that UITableView is no longer acting as a rep and calling audioPlayerDidFinishPlaying ? Any ideas?

Although the documentation did not say this clearly, I suspect that audioplayerDidFinishPlaying The call is deferred on the main thread (bold sentence by me):

The AVAudioPlayer class lets you play sound in any audio format available in the iPhone OS. You use a delegate to handle blockages (such as incoming phone calls) and update the user interface when the sound sound is finished playing . Representative methods of the AVAudioPlayer class have been described in the AVAudioPlayerDelegate Protocol Reference.

As long as there are some events to process, such as scrolling events, the call is waiting on the main thread.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -