问题描述:

My app is supposed to change the image file of a UIImage with a button push.

Then a sound file is supposed to play.

But the screen doesn't update until the sound file is finished playing.

Any suggestions would be greatly appreciated.

I've tried adding a delay, but I can't get this to work right.

Thanks.

网友答案:

This sounds (no pun intended) like you have not multi-threaded the code for playing the sound and changing the image. Hence your display is not updating until the sound has finished and the run loop can update the display.

网友答案:

Have you implemented a [audioPlayer prepareToPlay]; before hand?, I've noticed a slight "glitch in the matrix" when you try to play the sound for the first time.

Can you preempt the file to play? e.g. doing it at running at viewdidload?

btw...is the image in the button or somewhere else?

Regards

JimZ

相关阅读:
Top