Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent multiple UIAlertView from stacking up?

I'm using MPMoviePlayerController in iOS. I'm listening on any errors it may have while playing videos. In my error handlers, I pop up an UIAlertView. Sometimes errors may occur in quick succession of each other and thus multiple alert boxes will stack up. For a better user experience, I wish to not pop up another alert if an earlier one is still displayed.

like image 450
JoJo Avatar asked Aug 17 '11 21:08

JoJo


1 Answers

Try this:

Set a boolean to true when you pop up an alert, set it to false when you close an alert, and always check the boolean to see if it's true before you pop up an event. If it is true, you'll know you have an alert window already showing.

You can find this solution and some other discussion here.

like image 164
mopsled Avatar answered Nov 10 '22 17:11

mopsled