Apple recommends dismissing any UIAlertViews/UIActionSheets
when entering background state in iOS 4. This is to avoid any confusion on the user\'s part when he
if you only have one or two specific alert windows you show (as do most apps), then you can just create an assign
ivar to the alert:
@property (nonatomic, assign) UIAlertView* alertview;
Then, in the app delegate:
[self.viewController.alertview dismissWithClickedButtonIndex:[self.viewController.alertview cancelButtonIndex] animated:NO];
You can put this in applicationDidEnterBackground:
or wherever you see fit. It closes the alert programmatically upon application exit. I've been doing this and it works great.