Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check if a UIAlertView is showing

I have a method that posts HTTP data and displays a UIAlertView if there is an error. If I have multiple HTTP post I will show multiple UIAlertView for every error.

I want to show a UIAlertView only if is not showing other UIAlertView. How can I determine this?

like image 586
Ricibald Avatar asked Mar 27 '10 10:03

Ricibald


1 Answers

Why not just check the visible property, maintained by the UIAlertView class?

if (_alert) //alert is a retained property {     self.alert = [[[UIAlertView alloc] initWithTitle:@"Your Title"                                              message:@"Your message"                                              delegate:self                                    cancelButtonTitle:@"Cancel"                                    otherButtonTitles:@"OK"] autorelease]; } if (!_alert.visible) {     [_alert show]; } 
like image 118
Koen Avatar answered Sep 21 '22 07:09

Koen