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 7164685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:06:57+00:00 2026-05-28T14:06:57+00:00

The UIAlertViewDelegate protocol states the following: // Called when we cancel a view (eg.

  • 0

The UIAlertViewDelegate protocol states the following:

// Called when we cancel a view (eg. the user clicks the Home button). This is not called when the user clicks the cancel button. 
// If not defined in the delegate, we simulate a click in the cancel button 
- (void)alertViewCancel:(UIAlertView *)alertView; 

However, I have a UIAlertView that is displayed and when I now hit the Home Button in the simulator, the method alertViewCancel: does not get called. Please note that the alertView:clickedButtonAtIndex: delegate method gets called when I touch a button on the AlertView so the delegate is hooked up correctly.

Is this a bug on Apples side or is it me, or maybe the Simulator?

Edit:

I currently work around this issue by listening to the UIApplicationWillResignActiveNotification notification where I do the following to dismiss the AlertView:

[self.currentAlert dismissWithClickedButtonIndex:-1 animated:NO];
[self.currentAlert release];
self.currentAlert = nil;
  • 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-28T14:06:58+00:00Added an answer on May 28, 2026 at 2:06 pm

    It is called when the system actually cancels your alert view. Your alert view isn’t cancelled anymore when your application goes into the background as unless your app is evicted by the flotsam process, when you become foreground again, your alert view will popup again. I presume, though I don’t know for sure, that if flotsam kills your process, you’ll get this delegate call as part of the teardown sequence.

    The documentation is probably a bit misleading on this point. It used to be the case that home button presses canceled alerts, but it’s not always the case any more.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got the problem that the UIAlertViewDelegate method - (void)alertViewCancel:(UIAlertView *)alertView is not called
The UIAlertviewDelegate protocol has several optional methods including: - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex; This would
The UIAlertViewDelegate protocol defines two methods, alertView:clickedButtonAtIndex: and alertView:didDismissWithButtonIndex: , which seem to me
I have an alertview which displays fine. In my header I've included the UIAlertViewDelegate,
I have added an alertView to display an alert message to the user (see
I have a problem. This is my code. When i try to use the
In a class method method I declare the following: UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@Hello
my MasterViewController.h is as follows: @interface XYZMasterViewController : UITableViewController <NSFetchedResultsControllerDelegate, UIAlertViewDelegate> { NSMutableArray *array;
Am attempting to subclass UIAlertView to better handle error states in my app. The
@interface EAGLView1 : UIView<UIAlertViewDelegate> { @private /* The pixel dimensions of the backbuffer */

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.