Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7657857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:07:04+00:00 2026-05-31T13:07:04+00:00

In my application I need to remove any alerts visible in the window, when

  • 0

In my application I need to remove any alerts visible in the window, when the app goes to background.But the problem is that, I don’t want to dismiss it with

[alert dismissWithClickedButtonIndex:0 animated:YES]

because, it will trigger the clickedButtonAtIndex Delegate and will invoke a method.I wan’t to avoid this when app goes to background.

I did it successfully by removing the alertView from the subViews of window using the following code

  for (UIWindow *window in [UIApplication sharedApplication].windows) {
        for (UIView *view in [window subviews]) {
            if ([view isKindOfClass:[UIAlertView class]]) {
                [view removeFromSuperview];
            }

        }

But the problem is that the _UIAlertNormalizingOverlayWindow is still there and it blocks the user Interaction.I need to remove the _UIAlertNormalizingOverlayWindow also from my window.
Please help me to do this or please suggest any alternatives to achieve the solution .

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T13:07:05+00:00Added an answer on May 31, 2026 at 1:07 pm

    Although it’s not a very clean solution (assumes ivar BOOL _backgroundAlertFlag

    - (void)applicationDidEnterBackground:(UIApplication *)application {
        _backgroundAlertFlag = YES;
    
        // find your UIAlertView as you are doing already
    
        [alert dismissWithClickedButtonIndex:0 animated:NO];
        _backgroundAlertFlag = NO;
    }
    

    Then in your UIAlertViewDelegate method:

    - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
        if( !_backgroundAlertFlag )
        {
            // handle alert processing normally here
        }
        // other wise ignore (just dismiss)
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my application, _collection is a List from which I need to remove all
I have two application that need to talk to each other. App1 needs to
For my web application I need to close the child window whenever the parent
I have this application that need to do some things in protected paths (like
I need a way to remove unused images from my filesystem, i.e. images that
I am coding a WPF application using MVVM pattern. I don't need to have
I am developing an application for iPhone.I need to remove html entities like [<p>]
There's a proprietary application that I need that is packaged within a live ISO
When I start any application, that I wrote with python for my Nokia 5800(software
In the java web application need to select the file from server and print

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.