[Code Note] iOS-UIAlertView is automatically disabled, and uialertview is disabled.
I ,.
Ii. Code.
RootViewController. h
#import <UIKit/UIKit.h>@interface RootViewController : UIViewController<UIAlertViewDelegate>@end
RootViewController. m
-(Void) viewDidLoad {[super viewDidLoad]; // Do any additional setup after loading the view. // alert UIAlertView * alert = [[UIAlertView alloc] initWithTitle: nil message: @ "an Alert window that can be closed automatically" delegate: self cancelButtonTitle: nil failed: nil, nil]; [alert show]; // display box UIActivityIndicatorView * indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle: UIActivityIndicatorViewStyleWhiteLarge]; indicator. backgroundColor = [UIColor redColor]; indicator. center = CGPointMake (alert. bounds. size. width/2, alert. bounds. size. height-40.0); [indicator startAnimating]; [alert insertSubview: indicator atIndex: 0]; // timer [NSTimer failed: 3.0f target: self selector: @ selector (dismissAlert :) userInfo: [NSDictionary dictionaryWithObjectsAndKeys: alert, @ "alert", @ "testing", @ "key", nil] repeats: NO];} // alert automatically disappears-(void) dismissAlert :( NSTimer *) timer {UIAlertView * alert = [[timer userInfo] objectForKey: @ "alert"]; [alert dismissWithClickedButtonIndex: 0 animated: YES];}