If another alarm is displayed in the iPhone, a police report should not be displayed.

On the iPhone, how can I check if some UIAlertView is displayed before displaying the UIAlertView?
I don’t think there is any built-in way to determine if any alerts are displayed. My way of dealing with this in the past was by adding They are assigned to the following properties to track the alert view I am displaying:

UIAlertView *currentAlert;

When they are fired, set:

currentAlert = nil;

Then you just need to check currentAlert == nil, and then display another one.

Obviously, There are major disadvantages of this method, including but not limited to:

>It only applies to alerts you display, not system alerts
>You must implement UIAlertViewDelegate
>”currentAlert” property Need to include all the content that viewControllers can access, such as application delegates.

But this is the only way I know.

On the iPhone, How can I check if some UIAlertView has been displayed before displaying the UIAlertView?

I don’t think there is any built-in way to determine if any alerts are displayed. The way I handled this in the past was to track the alerts I was displaying by assigning them to the following properties View:

UIAlertView *currentAlert;

When they are fired, set:

< pre>currentAlert = nil;

Then you only need to check currentAlert == nil, and then display another one.

Obviously, this method has major disadvantages, including but not limited to:< /p>

>It only applies to alerts you display, not system alerts
>You must implement UIAlertViewDelegate
>The “currentAlert” attribute needs to contain all the content that viewControllers can access, such as applications Delegation.

But this is the only way I know of.

Leave a Comment

Your email address will not be published.