Is it possible to NOT dismiss a UIAlertView

Yes. Subclass UIAlertView and then overload -dismissWithClickedButtonIndex:animated:, e.g. @implementation MyAlertView -(void)dismissWithClickedButtonIndex:(NSInteger)buttonIndex animated:(BOOL)animated { if (buttonIndex should not dismiss the alert) return; [super dismissWithClickedButtonIndex:buttonIndex animated:animated]; } @end Unofficially you can define a -(void)alertSheet:(UIAlertSheet*)sheet buttonClicked:(id)button; method to the delegate which will make it bypass -dismissWithClickedButtonIndex:animated:, but it’s undocumented, so I don’t know whether it’s suitable for you.

Dismissing UIAlertViews when entering background state

My call would be to add a category to UIAlertview adding the following function : – (void) hide { [self dismissWithClickedButtonIndex:0 animated:YES]; } And to suscribe to UIApplicationWillResignActiveNotification : [[NSNotificationCenter defaultCenter] addObserver:alertView selector:@selector(hide) name:@”UIApplicationWillResignActiveNotification” object:nil];

Unable to add UITextField to UIAlertView on iOS7…works in iOS 6

You can’t easily alter the view hierarchy of a UIAlertView in iOS 7. (Nor should you; the documentation specifically tells you not to.) Head over to the developer forums to see a long discussion about it. One alternative in your case is to set alert.alertViewStyle = UIAlertViewStylePlainTextInput; This will add a text field for you. … Read more

iOS: Custom permission alert view text

Under iOS 6 and above, these can be setup to show specific messages. Edit your Info.plist by adding a few new entries. The keys all begin with “Privacy – ” (the raw keys are NSxxxUsageDescription where xxx is Contacts, Locations, Reminders, PhotoLibrary, or Calendards). The value is the text you wish to display to the … Read more

Changing the background color of a UIAlertView?

Background of AlertView is an image And you can change this image UIAlertView *theAlert = [[[UIAlertView alloc] initWithTitle:@”Atention” message: @”YOUR MESSAGE HERE”, nil) delegate:nil cancelButtonTitle:@”OK” otherButtonTitles:nil] autorelease]; [theAlert show]; UILabel *theTitle = [theAlert valueForKey:@”_titleLabel”]; [theTitle setTextColor:[UIColor redColor]]; UILabel *theBody = [theAlert valueForKey:@”_bodyTextLabel”]; [theBody setTextColor:[UIColor blueColor]]; UIImage *theImage = [UIImage imageNamed:@”Background.png”]; theImage = [theImage stretchableImageWithLeftCapWidth:16 topCapHeight:16]; … Read more

Check if a UIAlertView is showing

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]; }